Welcome to the Java Programming Forums
The professional, friendly Java community. 21,500 members and growing!
The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.
>> REGISTER NOW TO START POSTING
Members have full access to the forums. Advertisements are removed for registered users.
I am running the jar with the command
java -jar client.jar
Here is how I am exporting it in eclipse.
eclipse.jpg
It's being exported as a jar file, not a runnable jar.
Forget the IDE for the moment. Go into the bin directory and use the command line to jar the files (with the appropriate manifest file). Then place this jar in a directory alongside your other libraries and try to run. I mention this because my foggy memory recalls something about Eclipse packaging jar's in a strange way...trying it by hand will support this and let you know your manifest is technically correct. If so, I remember my workaround being an ANT script (you could also try to export as runnable jar)
Last edited by copeg; January 11th, 2013 at 11:12 AM. Reason: wording
I am unsure of how to compile from the command line with my setup. I have 3 packages and I don't know how to include them with the javac command.
The jar command is used to build a jar file, not the javac command.
Here's a sample batch file I use to build a jar file:REM Make InstantPP.jar file %DEV_DRIVE% SET JarName=%DEV_HOME%\JavaDevelopment\NormsDev\InstantPP\InstantPP.jar cd %DEV_HOME%\JavaDevelopment\NormsDev\InstantPP jar -cmf InstantPP.mnf %JarName% *.class Icons\*.png ButtonImages\*.png *.properties @REM Now pick up the Tools it needs: cd %DEV_HOME%\JavaDevelopment\ jar -uf %JarName% NormsTools\Bitmap*.class NormsTools\FindOurHome*.class NormsTools\SaveStdOut*.class @ECHO ---- Created: %JarName% ---- MORE
If you don't understand my answer, don't ignore it, ask a question.
Ok, I will run the jar command. I was running the javac command on my java files to create the class files, but I can just use the ones that eclipse generated. I need to package the client and packet packages, as well as the external jar. I will report back with my attempt.
--- Update ---
It indeed did work. I was able to make the jar with the jar command and putting in the packages and the jar file together into the same file. It doesn't throw the error anymore. I also exported it as a runnable jar, and it worked. Thank you
Glad you were able to get it to work.
If you don't understand my answer, don't ignore it, ask a question.