Lets say you created a little Java Desktop app with a jar and some dependencies and possibly a license text file. I know there are plenty of Ant tasks that can generate installers, executables and proper Mac OS X applications including packaging them as ".dmg" files. Examples would be JarBundler and Launch4j
Does similar things exist for Maven?
Thanks
OSX appbundle plugin
I also think launch4j has a maven plugin
To generate a windows executable in a maven build, you can use the launch4j-maven-plugin. I just answered a related question, Trying to integrate Launch4j in a Maven project using Alakai plugin, showing how to accomplish that. It's very easy, more than JSmooth, which always had a maven plugin.
Hope it helps!
Related
I recently found the library Libsodium and was glad that there are also Bindings for Java. Unfortunately, the libraries don't appear to work with Windows because they were developed for other systems.
How can I use the libraries under Windows (if possible)?
Are there any alternative libraries for Java?
On that page for other bindings, you find the Java binding is called Kalium. You'll see it requires Apache Maven. So I went and got that (at the bottom it explains how to install maven, but basically you just add some environment variables).
Now on to kalium, I got it from their abstract on github. I needed mvn clean install from the directory in order to install it in Maven. After changing directory to the unzipped Kalium folder I ran the specified command (which is telling Maven to get the files and install Kalium). This will handle the rest of the set-up.
Then it's just a matter of adding it as a dependency in your Maven projects as per the Kalium readme. As for libsodium: it is a library that works with MinGW, and VisualStudio in Windows. So if you want to do C/C++ coding you can use that instead. But for the Java binding it seems you'll have deploy it using Maven.
This question already has answers here:
How to include libraries in Java without using an IDE
(6 answers)
Closed 8 years ago.
I'm trying to use a java lib to connect to a database, im doing the tutorial outlined here, http://www.homeandlearn.co.uk/java/connect_to_a_database_using_java_code.html
and I can get it to work in netbeans by putting the .jar into the library file in my project file but I don't have a clue how to get it to work hen using an ide such as vim. can someone help?
If I got your question right, you can find the right answer on this other StackOverflow post: how to include libraries in java without using an IDE
You need to build both files into a JAR file, then you can run it.
I hope this helps.
A build tool which features dependency management such as Maven will help solve this problem. To use Maven you will add the location of libraries you require to an XML file (pom.xml) and Maven will download them for you and incorporate them in your target application archive (e.g. a war file).
Maven central provides a means to search for dependencies. In your case you can find the Derby client jar here. Click on the version of the library you would like to use and you'll see the sections of build descriptor code you needs to copy and paste in for: Maven, Ivy, and a few other popular build/dependency management tools.
Once you are comfortable with Maven, you could look up the Maven "Shade" plugin which will help you create a single jar file containing the necessary dependencies to run your application.
Vim, is more of an editor than an IDE, so you will need to specify the library .jar files manually on your class path when running your application.
You can do this by specifying the -cp parameter to the Java executable. e.g.
java -cp driver.jar MyMainClass
The way you are trying to use the library you desired requires manually adjusting your CLASSPATH. Oracle has some detailed instructions on that: PATH and CLASSPATH.
Though, I would suggest to use some kind of build tool which makes it easier to handle your applications dependencies.
In the Java world, the most convenient tools are Ant, Maven and Gradle.
I feel you have just started Java development, so I would prefer Gradle in your case, although Maven is still pretty widely used in projects.
With these build tools handling dependencies will not be -lets say- wired in the IDE and you can easily build your application in any environment.
do you know a highly configurable maven plugin for creating MS Windows installers?
The artifacts of my project are processed through a Maven Launch4j plugin, therefore I already have an executable (*.exe) file, but I need to install the other dependencies and resources as well: *.dll, images, the executable and so on. I also like to install the jre (if required), set some environment variables and so on.
Can you recomend a plugin?
Best regards.
I think you are looking for the nsis-maven-plugin
The nsis-maven-plugin enables Maven integration with the NSIS tools so
that Windows and Linux build machines can create Windows Installer
EXEs.
does appcfg.sh compile servlets or olny deploy compiled project ? If it doesn't how can I compile whole project in the command line?
It's highly recommended to use an IDE to build Java web projects, especially GAE projects:
Eclipse with Google Plugin (free)
IDEA with GAE plugin (commercial)
If you dislike IDEs, then at least use maven with gae plugin.
You can do this by specifying the right dependencies in your master BUILD file:
The binary should depend on everything it needs to run.
You can create another target for deployment. That target should depend on the binary, and also on everything else needed to deploy it.
Google AppEngine supports Apache Ant for command-line builds. AppEngine Java SDK also includes Ant macros to run appcfg.sh tasks from Ant.
It would be even better if the same standalone tool can also support browsing repositories over other protocols than file system
I've found this simple tool which is great
http://code.google.com/p/mycila/wiki/MavenDeployer
The small tool maven-install-ui (https://github.com/escv/maven-install-ui) offers a simple UI to install jar files locally.
Well, NetBeans comes at least with a local Maven repository browser, but I think it currently doesn't have a GUI to install new jars
why not use the atifactory . You can install new jars from web UI