Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (522)
Games in Android Showcase (127)
games submitted by our members
Games in WIP (590)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  eclipse problem exporting jar  (Read 2479 times)
0 Members and 1 Guest are viewing this topic.
Offline Aramaz

Junior Devvie




Java Games Rock!


« Posted 2005-05-20 15:10:00 »

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...

anyone have an idea what I'm doing wrong?

Play XSW: www.xsw.se
Offline ryanm

Senior Devvie


Projects: 1
Exp: 15 years


Used to be bleb


« Reply #1 - Posted 2005-05-20 16:33:12 »

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.
Offline blahblahblahh

JGO Coder


Medals: 1


http://t-machine.org


« Reply #2 - Posted 2005-05-20 16:44:52 »

Well, you could try just typing it in...

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.

malloc will be first against the wall when the revolution comes...
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Aramaz

Junior Devvie




Java Games Rock!


« Reply #3 - Posted 2005-05-21 04:14:18 »

Thanx for the answers...

Eclipse seems to not be uptodate at all times with the filesystem in those dialogs...

I made my own manifest.mf, and used export... but still have problems, it can't find the external classpaths I'm using...

manifest.mf:
Manifest-Version: 1.0
Classpath: ./libraries/gagetimer/timer.jar ./libraries/lwjgl/lwjgl.jar
Main-Class: raz.Main

output when I try to run:

java -jar SpaceWar.jar

Exception in thread "Thread-0" java.lang.NoClassDefFoundError: com/dnsalias/java
/timer/AdvancedTimer
       at raz.SpaceWarServer.Server.<init>(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...

is there a way to include that in the manifest?

Play XSW: www.xsw.se
Offline K.I.L.E.R

Senior Devvie




Java games rock!


« Reply #4 - Posted 2005-05-21 05:09:28 »

I know what your problem is.

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.

Here is a little tutorial I made:
http://members.optusnet.com.au/ksaho/show/tutorial.zip

I'm pretty sure the 2nd picture is what you missed on doing.
I made the thing clear as possible.

There's no reason why Eclipse can't Jar everything up in complex projects.

Vorax:
Is there a name for a "redneck" programmer?

Jeff:
Unemployed. Wink
Offline blahblahblahh

JGO Coder


Medals: 1


http://t-machine.org


« Reply #5 - Posted 2005-05-21 09:49:22 »

Quote

Eclipse seems to not be uptodate at all times with the filesystem in those dialogs...


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

I made my own manifest.mf, and used export... but still have problems, it can't find the external classpaths I'm using...

manifest.mf:
Manifest-Version: 1.0
Classpath: ./libraries/gagetimer/timer.jar ./libraries/lwjgl/lwjgl.jar


Um, read the docs Tongue? 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).

Quote

I suppose I also need a library parameter for the java VM (-D) to ue lwjgl and gagetimer...

is there a way to include that in the manifest?


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.

malloc will be first against the wall when the revolution comes...
Offline hawkwind

Junior Devvie




Java games rock!


« Reply #6 - Posted 2005-05-21 16:52:21 »

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...  


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.
Offline blahblahblahh

JGO Coder


Medals: 1


http://t-machine.org


« Reply #7 - Posted 2005-05-21 19:41:05 »

Quote


independent and occasionaly out of sync with the actual disk.  You
...
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! Grin

malloc will be first against the wall when the revolution comes...
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

trollwarrior1 (33 views)
2014-11-22 12:13:56

xFryIx (73 views)
2014-11-13 12:34:49

digdugdiggy (52 views)
2014-11-12 21:11:50

digdugdiggy (46 views)
2014-11-12 21:10:15

digdugdiggy (40 views)
2014-11-12 21:09:33

kovacsa (65 views)
2014-11-07 19:57:14

TehJavaDev (69 views)
2014-11-03 22:04:50

BurntPizza (68 views)
2014-11-03 18:54:52

moogie (82 views)
2014-11-03 06:22:04

CopyableCougar4 (82 views)
2014-11-01 23:36:41
Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!