Re: Running a JOGL app from a single JAR file
Posted by
gouessej on
Jan 14, 2015; 10:32am
URL: https://forum.jogamp.org/Running-a-JOGL-app-from-a-single-JAR-file-tp4033846p4033849.html
sasq wrote
I don't know. Would I?
What you described in your first post made me think that you want to make a single fat JAR with everything in it, i.e a fat JAR (or any variant doing almost the same thing).
sasq wrote
I see that this technique is "discouraged" at the website you provided.
It's discouraged mainly because it mixes up everything (your code + third party libraries) together, making it hard to indicate that what was in a JAR came from a specific organization.
sasq wrote
What I want is to make a self-contained JAR file available for download and run by the user which doesn't have any JOGL libraries installed on his machine. If the "fat JAR" solution allows this, then yes, I would like to create one.
It's the most commonly used solution to achieve that even though I go a little further in my case.
sasq wrote
On that website they also say:
Furthermore, adding all native library files for all supported platforms will add-up to +3M of _compressed_ jar data!
Could this be avoided by providing a
set of several self-contained JAR files, each for one supported platform? This way, they would together still be weighty, but the user could select the one compatible with his platform, which is a fraction of the whole set and less weighty to download, I guess?
It's possible but is it worth the effort? It depends on the size of your application.
sasq wrote
Which files should I put into that JAR and in what structure to make it work? I'd like to put there only a minimal set of files which are actually used by my application. How can I figure out which are needed?
I advise you to make it work first with the JARs mentioned in the second post. Then, you will be able to reduce the size of the JAR by using some atomic JARs but again is it worth the effort?
sasq wrote
Oh, I forgot to add in my original post that I don't use Ant, Eclipse, NetBeans, nor any other IDE, just plain old text editor and a command line on Linux. I'll try to add it to my original post...
You don't need an IDE to make a fat JAR. There are some softwares for that but they are a lot less flexible than the build tools like Ant.
sasq wrote
Hmm, but it turns out that I have the ant command on my system, so perhaps I could use it somehow... I'll need to dig into the post you linked, but for now it's black magic to me. Can you advice me any additional URLs I should check out to find more about what is this ant and how to use it?
I advise you to read this tutorial:
https://ant.apache.org/manual/tutorial-HelloWorldWithAnt.htmlSee Ant as a cross-platform make :)
I advise you to read carefully my post, it mentions tons of fat JAR limitations.