Is it possible to create a self-executable Jar file for a Java3D app with all of the Java3D libraries (for mac/win/linux) all in the same jar file? I feel like I’ve seen this done before but now that I actually want to do it myself I can’t find any examples of it I’m hoping to be able to do this as an alternative to Webstart. Can this be done?
AFAIK Java3D installs its stuff in java.ext.dirs by default.
Something tells me that it should ‘just work’ when the files are copied into the
directory of the game, with proper classpath references.
One exception to this was the Java Comm API, which had the paths hardcoded
into the classes in the JAR.
I decompiled the class and changed it - yes, I know that’s illegal.
I’ve done it in a way that packed the whole JRE and all of J3D into one package, but it wasn’t small. Fine if you’re handing out CDs, not great for downloads.
For FlyingGuns I used JSmooth to create a binary distribution including Java3D. Just it is platform dependent.
Check out the FG download to see wether you like it.
Back in 2005 I made a utility (bJAR) which re-compressed Executable Jar files using more advanced compression algorithms instead of Deflate.
The output Jar is fully complient with java 1.4 1.5 and 1.6 and i believe that it is complient with 1.3 and 1.2.
By using the LZMA option I could achieve pretty decent reduction in size. e.g.
The jude-community.jar in the community version of JUDE is 4,614,701 bytes when compressed using Deflate, but when compressed using bJAR and LZMA option 3 I am able to reduce the size of the JAR to 2,323,990 bytes.
The JAR works as before. The only change is that there is a slight ( almost unoticable) pause before the java ap loads.
I have attached the utility to this post… you will have to remove the pdf extension.
This may make the option of including all of your libraries in a single executable JAR more viable. If you do add your libraries into one JAR, make sure you either decompress these library jars into your project structure if including the library JARs inside another JAR make sure the library JARs are uncompressed JARs. In this way you will achieve maximum compression using the bJAR utility.
Interesting … can bJAR be used in the context of webstart as well?
I have not tried it in a webstart environment… I dont see why it should not…
hmm
actually it might complain about security as it does funky things with classloaders substituting the default classloader with that of one generated by the java process.
I am much interest to know how you included Java3D into the distribution using JSmooth. I just downloaded your game and that worked really well (very nicely done!!). Our product is now in Beta release (see also www.sudoku-ball.com) but the most difficult part is the deployment. Could you provide more details on how you included java3D?
Thanks, Marcel
Hi!
Here is my jsmooth config file … does this help already?
http://drts.cvs.sourceforge.net/drts/projects/flyingguns/etc/FlyingGunsClient.jsmooth?view=log
Hi Herkules,
Thank you.
Marcel