Board index » jbuilder » Still problems creating EXECUTIBLE jar files

Still problems creating EXECUTIBLE jar files


2004-04-08 03:42:22 AM
jbuilder10
OK, I have made progress, but I am still running into problems. I am trying
to experiment with executible jar files, and I am doing so from the commend
line since it doesn't seem to be supported with the personal edition of
JBuilder9 (if it is, then there is a problem with how it works since my
manifest file seems to be over written by an empty one every time a project
is rebuilt and before the build is done so the jar file is made but without
anything specified in the hand written manifest file being used).
Any, I can proceed, after a fashion, using the SDK (I have one installed
that is a minor revision or two more recent than tht in JBuilder9). I have
it so that when I try to execute the application, it finds function main.
But this morning, I was getting the following error:
H:\JavaProjects\HotImage\HotImage\classes>java -jar HotSpotImageTest.jar
Exception in thread "main" java.lang.NoClassDefFoundError:
com/borland/jbcl/layout/XYLayout
at hotimage.HotSpotImageTest.<init>(HotSpotImageTest.java:20)
at hotimage.HotSpotImageTest.main(HotSpotImageTest.java:75)
If I am not totally senile, that is a problem of Borland's library not being
found in the classpath.
So, I changed the manifest file to the following:
Class-Path: G:\JBuilder9\lib\jbcl.jar G:\JBuilder9\lib\jbuilder.jar
Main-Class: hotimage.HotSpotImageTest
Sealed: true
And now the error is changed to :
H:\JavaProjects\HotImage\HotImage\classes>java -jar HotSpotImageTest.jar
Exception in thread "main" java.lang.NoClassDefFoundError:
hotimage/HotSpotImageTest
Now, as you can see, there is no indication as to what it can't find. This
gives the illusion that it can't find the main class implementing tha whole
application/applet, but I can toggle between the two errors (the first of
which clearly indicates that the main class is being found) just by adding
or removing the line providing the class path (and it doesn't seem to matter
WHERE in the manifest I put it). What is happening here?
I used the option "Sealed: true" in the apparently mistaken belief that it
would include in the jar file everything that the application needs to run.
What did I miss?
Thanks,
Ted
 
 

Re:Still problems creating EXECUTIBLE jar files

It looks like in the second test you left out the Jar with your code in
it! Certainly that is what JB is telling you - it doesn't know what JAR
your code is in!
Brad
Ted Byers wrote:
Quote
OK, I have made progress, but I am still running into problems. I am trying
to experiment with executible jar files, and I am doing so from the commend
line since it doesn't seem to be supported with the personal edition of
JBuilder9 (if it is, then there is a problem with how it works since my
manifest file seems to be over written by an empty one every time a project
is rebuilt and before the build is done so the jar file is made but without
anything specified in the hand written manifest file being used).

Any, I can proceed, after a fashion, using the SDK (I have one installed
that is a minor revision or two more recent than tht in JBuilder9). I have
it so that when I try to execute the application, it finds function main.
But this morning, I was getting the following error:

H:\JavaProjects\HotImage\HotImage\classes>java -jar HotSpotImageTest.jar
Exception in thread "main" java.lang.NoClassDefFoundError:
com/borland/jbcl/layout/XYLayout
at hotimage.HotSpotImageTest.<init>(HotSpotImageTest.java:20)
at hotimage.HotSpotImageTest.main(HotSpotImageTest.java:75)


If I am not totally senile, that is a problem of Borland's library not being
found in the classpath.

So, I changed the manifest file to the following:

Class-Path: G:\JBuilder9\lib\jbcl.jar G:\JBuilder9\lib\jbuilder.jar
Main-Class: hotimage.HotSpotImageTest
Sealed: true

And now the error is changed to :

H:\JavaProjects\HotImage\HotImage\classes>java -jar HotSpotImageTest.jar
Exception in thread "main" java.lang.NoClassDefFoundError:
hotimage/HotSpotImageTest



Now, as you can see, there is no indication as to what it can't find. This
gives the illusion that it can't find the main class implementing tha whole
application/applet, but I can toggle between the two errors (the first of
which clearly indicates that the main class is being found) just by adding
or removing the line providing the class path (and it doesn't seem to matter
WHERE in the manifest I put it). What is happening here?

I used the option "Sealed: true" in the apparently mistaken belief that it
would include in the jar file everything that the application needs to run.
What did I miss?

Thanks,

Ted


 

Re:Still problems creating EXECUTIBLE jar files

"Bradley Kieser" < XXXX@XXXXX.COM >wrote in message
Quote
It looks like in the second test you left out the Jar with your code in
it! Certainly that is what JB is telling you - it doesn't know what JAR
your code is in!

But that doesn't seem possible because I used exactly the same commands both
to build and to run the application in both cases.
To build, I use the following command, and get the output shown IN BOTH
CASES:
H:\JavaProjects\HotImage\HotImage\classes>jar cvfm HotSpotImageTest.jar
hotimage\manifest.mf hotimage\*.class hotimage\*.jpg
added manifest
adding: hotimage/HotSpotImageTest.class(in = 4757) (out= 2304)(deflated 51%)
adding: hotimage/HotSpotImageTest_jLabel1_mouseAdapter.class(in = 683) (out=
358)(deflated
47%)
adding: hotimage/HotSpotImageTest_jLabel2_mouseAdapter.class(in = 935) (out=
413)(deflated
55%)
adding: hotimage/sunset.jpg(in = 100096) (out= 99228)(deflated 0%)
And to run, I use the following:
java -jar HotSpotImageTest.jar
So HOW am I confusing it with regard to where my code is?
Cheers,
Ted
 

{smallsort}