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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how import .class file

Status
Not open for further replies.

fuadhamidov

Programmer
Sep 22, 2003
98
TR
hi

i have problem while importing .class.
my case:
i use jakarta-tomcat ( 4.1.27 )as web server and Net-Beans.
until now i have only use (and create) jar. i put jar in web-inf/lib. and i could easily import packages.

problem:
i need to use a jar (say it is bbb.jar) that contains .class file not in folder. i have tried several cases to compile my jar (not bbb.jar) but i was unsuccessful.
my jar is in web-inf/lib.
i put the .class file in web-inf/classes and same folder wiht web-inf (and jsp's).
i try to add statement to import class
(1.import aaa; 2.import aaa.class;)
to java but it gives error.

what should i do?
 
Tomcat 4 uses the SDK1.4 comiler, and does not support classes that are not in a package - hence your error trying to import the class.

Just don't import the class - Tomcat should pick it up automatically from the jar in the /lib directory - if not, unjar it and dump it in /classes directory.
 
OK,
i have done your suggestion and can't compile again. i think the problem is in NetBeans. i use NetBeans 3.5.1. beacuse i can't compile ".java" file in which i call the (unimported) ".class" file. the tomcat has stopped.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top