I am working on a multiplayer space shooter game in Eclipse, it runs fine from the IDE, but now I want to export it so I can test on different machines.
I use export Jar… generate Manifest file…
but when I click browse to select main class file there is nothing in the list to choose from…
I would reccomend trying GenJar. It’s an Ant task that generates a jar file based on class dependencies. You supply it with the entry point(s) to your application and a classpath to search, and it’ll pull only the classes that are actually used into a jar file.
Eclipse’s Jar generation seems only able to operate on a coarse-grained (project,package,…) level, so i really wish some generous soul would integrate GenJar as a plugin or some such thing. In any case, once you have your ant buildfile correct, it’s trivial to call it from the Eclipse gui.
Anyway, it looks to me like it will only show stuff if you actually have a valid correct public static void main(…) - and if not, it probably won’t show anything.
Or maybe it’s Eclipse’s search dialog - you have to start typing characters to make some options appear.
Easiest workaround is just to do it once, let it make the manifest in the workspace, then edit it manually and add a main-class attribute.
Exception in thread “Thread-0” java.lang.NoClassDefFoundError: com/dnsalias/java
/timer/AdvancedTimer
at raz.SpaceWarServer.Server.(Server.java:257)
at raz.Main$1.run(Main.java:24)
Exception in thread “Thread-1” java.lang.NoClassDefFoundError: org/lwjgl/LWJGLException
I suppose I also need a library parameter for the java VM (-D) to ue lwjgl and gagetimer…
When you were going through the Jar export dialogue did you specify the “Main” class?
2nd of all you don’t need to build your own manifest; I don’t.
Just make sure any external dependencies are used and accessed outside of your project, this way you can include them externally as jars.
I had to do this when supplying LWJGL with my project.
E certainly has plenty of annoying bugs, however I’ve never seen anything on the scale of badness as being out of synch with the FS, so I’m almost certain that’s not true. Unless you are running a beta, in which case … well, you’re on your own. Officialy you aren’t supposed to use such things for “real” code, so…
Um, read the docs :P? It’s “Class-Path:”.
Doesn’t matter, but you don’t need the leading “./” and long experience with Sun’s JVM’s suggest it’s a bad idea - sometimes their code won’t work if you include a “./” (although maybe all those bugs have now been fixed, I wouldn’t bother risking it).
This is better covered in LWJGL’s instructions I believe; off the top of my head you usually need the -Djava.library.path=. option on linux because of IIRC bugs in sun’s loading of libraries under linux, but not for any other OS (whose JVM’s do things properly when loading nativelibs). If you launch it via webstart, all will be fine.
[quote]E certainly has plenty of annoying bugs, however I’ve never seen anything on the scale of badness as being out of synch with the FS, so I’m almost certain that’s not true. Unless you are running a beta, in which case … well, you’re on your own. Officialy you aren’t supposed to use such things for “real” code, so…
[/quote]
Eclipse actually maintains its own vision of the file system, independent and occasionaly out of sync with the actual disk. You can mouse over a project, right click, and select refresh to sync up. It is truely weird in some cases, quite often it can file image files without refreshing the file system, text files on the other hand often could not be found when doing searches or refactoring…very confusing at times.
I have NEVER successfully exported a jar from eclipse…I actually use an older version of netbeans for this…choose an alternate approach, not eclipse, seems to be a good approach.
Well, I’ve been using it for a year or two on many computers, spread betwen OS X, linux, and windows. On a typical day, I will use it at least once on each platform (I kid you not: OS X on the train because iBooks have more battery power than anything else you can buy, then windows at work with a couple of Gb RAM, then on my linux desktop when I get home). I’ve never had any problems - and every day I’m using FS’s mounted across several different protocols and networks, for instance most of the day I’m on Samba shares, and in the evening I’m developing on symlinked NFS shares.
So, whilst I don’t deny your troubles, I can honestly say I’ve smacked it around an awful lot and it’s never made a mistake yet. My reputation here is generally for being THE person who finds all the bugs that no-one else has problems with, so this is a novel experience for me! ;D