This week's book giveaway is in the General Computing forum. We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line! See this thread for details.
I created my runme.jar for some final testing and have hit a snag as the error messages and my log messages are not being displayed when I run this. My log file is set up as follows:
Everything works fine in Eclipse.
So for example running "runme.jar a" in Dos just exits the application with no messages.
If I run this in Eclipse I get:
Has anyone else encountered this problem. I am using java 1.6.0_12
Hi Kevin, I don't personally use Eclipse but Netbeans, but the idea is the same. Does Eclipse use any internal classpath you are not aware of? How does Eclipse build the application?
If you don't use Eclipse to build the app, but use command prompt, do you get the same result when running the app?
Did you include a manifest file when "manually" creating your runme.jar specifying the main class and remember the extra line at the end?
If you use Windows OS you may want to use batch files to compile and create the jar.
My file structure looks like this in the root:
docs dir - documentation files go here
code dir - source files go here
classes dir - compiled class files go here
version.txt
database file
runme.jar
manifest.txt
whole bunch of batch file xxx.bat
Then my build.bat file looks like this
javac -d classes code/<full-package-name>/*.java
jar cvfm runme.jar manifest.txt -C classes .
Then my run file looks like this where "alone" is the mode flag:
java -jar runme.jar alone
If all goes wrong, check your app entry point main method.
Kevin Florish
Ranch Hand
Joined: Jan 06, 2009
Posts: 155
posted
0
Hi Ken
I have no problem compiling the classes and the jar file works fine (yes I have a Manifest.mf file for this).
I do the following from the code subdirectory:
then after I move up to my main directory I do:
My problem isnt getting a working jar its the fact that I am not getting system messages and log messages in Dos window. Everything else I test seems to work (gui display, booking etc) its just these missing log messages and system error messages that have me stuck at the moment.
is it be possible that you are using "javaw.exe" to launch your jar (rather than java.exe) ? How do you launch your jar ? Manually with the "java -jar.." command or do you double click on it ?
You could check to which executable .jar extention is linked on your OS.
bye,
Alex
Kevin Florish
Ranch Hand
Joined: Jan 06, 2009
Posts: 155
posted
0
Hi Alex.
Thanks for that post, I had become blinkered there and was just running runme.jar