Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Jar Issue

Status
Not open for further replies.

Respect

Programmer
Dec 11, 2002
7
CA
Hey all,
I am trying to run my code from a jar file. When I run the code through a class folder java can see all the classes but when I put all the classes inside a jar file there is ONE class that is not being seen. "java.lang.NoClassDefFoundError" Exception. I have checked the jar file and the class is clearly there. This is odd. Any ideas?
Please reply ASAP

Thanks

Respect
 
Post the path of the file in the jar and the package statement code from the java file.

-pete
 
The class is not in a package. So there is no package call in the java class and there is no path in the jar file. The class is actually an inner class about 3 or 4 levels deep. My first assumption was that there may be some limitations with reading inner classes in jar files but this is not the case as I have a few other inner classes which are also 3 or 4 levels deep.
It may be worth wild to note that I am using Java 1.1.8
 
even though it is an innner class, when an outer class with an inner class is compiled, it should produce two classes.
for instance:-

outer.class
outer$inner.class

hence, both of these classes need to be in the jar file.


~za~
You can't bring back a dead thread!
 
post the entry for the .class file in the jar. Nested classes have '$' character delimiters in their paths.

myclass$nestedclass.class

-pete
 
hey Pete,
I'm not sure I understood your last request but i'm assuming you just wanted the name of the class that's giving me problems in the jar. Here it is...If i got this wrong just let me know.

Class name :TeacherAppl$View$MainView$ReportView$PrintClassListReport.class
 
>> It may be worth wild to note that I am using Java 1.1.8

I'm not aware of any problems with 1.1.8 but i am suspicious now. Do you have 1.4 installed? If so what happens when you run it under 1.4?

-pete
 
It WAS 1.1.8. But not what you all may think. Java 1.1.8 was actually throwing the wrong class name with the Exception. When I ran it with Java 1.4 it threw the right error and It was actually a package that was not included in the jar file. That one got me.

*Applaud java 1.1.8" lol
 
Oh yea.. Thanks to everyone who helped. I really appreciate it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top