JarSplice - The Fat Jar Creator

-Introduction
-Features
-Screenshot
-Download
-Frequently Asked Questions
-History

Introduction
Deploying Java Applications can be a pain if your application has multiple jars and native libraries. There are the options of using Java Web Start or Java Applets however these are not always suitable.

Executable Jars are an option, however if your project has multiple jars or native files then it can be tricky to use this option.

JarSplice attempts to solve this issue by allowing you to merge all your jars and native files into one, easy to use executable jar file.

Features

  • Creates a single executable fat jar via an easy to use GUI.
  • Automatically extracts only the native files needed for the OS the jar is running on.
  • Automatically cleans up any extracted native files after the application quits.
  • Add VM arguments on jar creation which removes the need to enter them via the command line.
  • Optionally create a Shell Script (*.sh) launcher for Linux with embedded fat jar.
  • Optionally create an OS X App Bundle (*.app) for running your application.
  • Optionally create a Windows Application (*.exe) for running your application.

Screenshot

Download
JarSplice-0.40.jar (135.8kb Executable Jar)

Frequently Asked Questions
Q. What License is JarSplice under?
A. JarSplice is free to use for any type of application. The source code for the actual JarSplice application will be under a BSD Licence. Anything produced with JarSplice remains under the same licence as the input.

Q. Does JarSplice create Jar files from source/class files?
A. No, you must put your project files into a jar file before using JarSplice. Most IDE's have this feature built in and allow you to export your class and resource files to a jar.

Q. Does JarSplice create Windows Executables (*.exe files)?
A. While the Executable Jar files (*.jar) produced by JarSplice run on windows just by clicking them you may want an exe files instead. Exe files have a slight advantage in that you can associate an icon with them and that end users are more familiar with running them. Tools such as Launch4j or JSmooth can produce exe files that can wrap or launch jar files. If you create the executable jar with JarSplice you should be able to wrap it into a single exe file, alternatively you can just include an exe launcher with the jar file so that end users on linux and mac can also start the jar file from the same bundle.

Q. How do you create *.icns icon files for use with OS X .app bundles?
A. This is the Apple Icon Format used by OS X for App Bundles. Many image editing tool like the GIMP and Photoshop support the format. You can also use free online converters like iConvert to create *.icns file.

History
0.40 - 27/06/12 - redone parts of the GUI (fixes file dialog issues on OS X), added option for creating OS X .app bundles and Windows .exe files.
0.30 - 17/06/12 - added success/failure message on jar creation, use same jvm for app as JarSpliceLauncher
0.25 - 19/06/11 - added support for vm arguments.
0.20 - 05/06/11 - added support for creating linux shellscripts, separated core code from gui code, improved layouts on gui.
0.16 - 01/06/11 - added ability to remember last location when using JFileChooser.
0.15 - 31/05/11 - fixed problem with Windows paths.
0.10 - 22/05/11 - initial release of JarSplice.

If you have any comments, bug reports or RFE's just post them as a comment below.

Comments

Please, add the CLI/ANT support ASAP, we'd love it!

Anonymous Ninja
Tue, 06/12/2012 - 17:15

Since I don't see the subject, the post below is asking about user entered command line parameters, static data.

Anonymous Ninja
Tue, 06/12/2012 - 14:56

Is this possible with JarSplice? It's a pretty big part of executable jars....

Anonymous Ninja
Tue, 06/12/2012 - 14:55

how do you pass command line args to the inner jar file? Seems no way to do this. Please fix or release src.

Anonymous Ninja
Thu, 05/17/2012 - 09:24

Hello,
is the source code available? I would be interested in finding out how the tool works and doing some modification...
Greez,
Lukas

Anonymous Ninja
Wed, 05/09/2012 - 20:48

worked flawlessly for me first time of asking. Definite plus-one for non GUI interface to it though. Would be better shipped as a lib that a GUI, CLI or Ant Task could use as a dependency. Thanks for making it available though.

Anonymous Ninja
Wed, 05/02/2012 - 11:51

Hi Thanks for the wonderful tool

Anonymous Ninja
Tue, 04/10/2012 - 13:30

Hi i found its a good tool

Anonymous Ninja
Tue, 04/10/2012 - 13:29

Hi! Thank you for this useful tool! I've a suggestion to improve the native section: suppose I've two native libraries for two different OS (Linux, Windows). Each native lib has 32 and 64 bit version. It would be great to map which library launch at runtime depending on the current OS. I would package all native libraries for all supported OS in every case, it's the drawback of this kind of solution but could be acceptable. So the native section would have, let's say, 4 textfields:

Windows x86 library(ies) path: ..............
Windows x64 library(ies) path: ..............
Linux x86 library(ies) path: ......…
Linux x64 library(ies) path: ......…

Than the generated launcher will load into -Djava.library.path the appropriate native libraries depending on current OS which the application is running on.

Anonymous Ninja
Thu, 03/29/2012 - 15:31

How can I use JarSplice in an ant build? Will this be supported?

Anonymous Ninja
Wed, 03/21/2012 - 19:29

atm you can't really use it with ANT, since its gui only, however there are plans to add command line and ANT support soon.

admin
Wed, 03/21/2012 - 21:40

One more vote for cli-version!

Thanks for this, and all the tutorials also :)

Anonymous Ninja
Mon, 04/16/2012 - 07:12

tried jarSplice, but cant get it to find my main class. can someone give me the step by step rundown starting from the native code to the finished product?

Anonymous Ninja
Fri, 01/20/2012 - 23:09

try asking in the #lwjgl irc channel, someone there might be able to help http://webchat.freenode.net/?channels=lwjgl

admin
Fri, 01/20/2012 - 23:16

This executable jar approach has made distribution much easier for me, but embedding my LWJGL games in a web page is still desirable. Is this possible with the jars that Jarsplice produces (to your knowledge) or do I need to go back to wading through applet bugs?

Anonymous Ninja
Wed, 01/04/2012 - 20:05

The JarSplice jar can't be embedded into a webpage, you need to write your application as an applet and then use something like LWJGL's AppletLoader to deploy it.

Anonymous Ninja
Fri, 01/06/2012 - 14:04

Hi Kappa,
just gave it a try with my Slick competition entry and at least for Windows it worked like a charm! Can't test on other platforms though.
One improvement suggestion: The file dialogs should remember the last used directory (jars and native libs are very often in directories nearby...).
In the Slick forum you mentioned you would think about adding an .exe file for Windows, an .sh for Linux and a Mac package. I think that would be a cool feature to add!
Cheers,
Tommy Haaks (www.rightanglegames.com)

Anonymous Ninja
Wed, 06/01/2011 - 12:13

hey guys, i've been working on a 2d game using lwjgl for 4 months now. it's due in a week and i cannot for the life of me get it to compile into a single jar. i've tried multiple tools and it keeps telling me my main class cannot be found.... any help please?

Anonymous Ninja
Fri, 01/20/2012 - 23:08

what are you entering for the main class?

admin
Fri, 01/20/2012 - 23:14

Added the ability to remember the last used directory when using the file dialog. Up next hopefully I'll add .sh support for linux.

admin
Wed, 06/01/2011 - 22:07

the size of the final jar exported from jar splice, is very big,
i made a simple program that uses slick and lwjgl,
the size of final fat jar is 5,72 MB , witch is too big

i have a jar from the internet that have much more graphics, classes, pictures etc. and have only 497 KB

how can i use jar splice but at the same time make jars small sizes?

thanks

Anonymous Ninja
Tue, 12/11/2012 - 08:20