Ok, yes, I know there’s jnlp, and I know how great Java Web Start is for games and such, I read all about that searching for related topics. But since I don’t have a server set up, and I’d rather just double-click a simple offline file, I want to figure out how to do .jar files for now. Also there’s something I like about making java applications as close as possible to the c++ .exe files, without actually having to be them.
That said, right now I’m trying to figure out how to make an executable jar file that contains the libraries for Xith3D. Specifically, I want it to contain the Xith3d.jar and vecmath.jar, such that any person who runs the file and does not have xith will be fine. Note that in this particular case, I already have JOGL installed on this computer, so I’m not attempting to include those files. I figure I can just reapply the same concept if I need to though.
To be absolutely clear, here’s a mini-screenshot of what my current package explorer looks like:
http://img197.imageshack.us/img197/7370/xithpath5tx.jpg
As you can see, I created a couple of Classpath Variables (probably a mistake for my objective…) and added them through the Project - Properties - Java Build Path - Libraries tab.
If I select my .java file then, and use “Run as application”, it works just fine. I get my standard frame, along with the basic colored cube in the view. When I take this file and use the standard File - Export - JAR File wizard, however, I get an “executable” file that returns the message “Could not find the main class. Program will exit.” in a dialog box at runtime.
So, evidently, I’m not actually putting anything in the jar, and what I’ve done is only helping Eclipse out (in terms of my situation, anyway). I’ve tried throwing around a few other file imports and such, but I really just don’t know what to do. Hopefully this is a easily solveable problem for the eclipse experts out there.
Appreciate your time.
Thanks.
The files do appear to be a little larger than I would have expected (the whole jar is bigger than all the libaries inside of it?) but I might be able to cut it down somehow. Still it’s exactly what I wanted, and very very easy to use (about 20 seconds to set up the jar the first time, 3 seconds or so the second time, and maybe 5 seconds while it compiles the information).
;D ;D