GeeCON Prague 2014*
The moose likes Beginning Java and the fly likes Can't find ..\lib\ext\ packages Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Can Watch "Can New topic
Author

Can't find ..\lib\ext\ packages

Alex Prawira
Greenhorn

Joined: Mar 05, 2005
Posts: 16
Hi,

I got some problem here.
I have my package named MyGeometry.jar
I have an application that use clasess from that package, called DrawingAppl
But when i want to run my DrawingAppl, the application won't start, throwing "... not found exception"

I suppose the clasess and packages in the .jar archive that i places in the "ext" folder will automatically be

accessible when you run my Java programs, without need -classpath command.


I'm in --> "D:\TestAppl\classes"

Commands that don't work
--------------------------------
java "DrawingAppl"
java -cp "D:\TestAppl\classes" "DrawingAppl"
java -cp "C:\j2sdk1.4.2_05\jre\lib\ext;D:\TestAppl\classes" "DrawingAppl"


Only this that work !
------------------------------
java -cp "C:\j2sdk1.4.2_05\jre\lib\ext\MyGeometry.jar;D:\TestAppl\classes" "DrawingAppl"

I'm so confused about this problem. Please help me.
Layne Lund
Ranch Hand

Joined: Dec 06, 2001
Posts: 3061
When you have classes in a .jar file, you must add the jar file itself to the classpath. Simply adding the directory that contains the jar file isn't enough. That's why only the last one works.

Layne


Java API Documentation
The Java Tutorial
Ajay Bhargov
Ranch Hand

Joined: Mar 07, 2005
Posts: 31
hi

I think that once you store all your .jar files in the ext folder present inside the java directory , it will be automatically be loaded. There is no need to add the .jar file to the classpath.


With Regards,<br />Ajay
Premil Jacob
Ranch Hand

Joined: Sep 10, 2004
Posts: 30
If ur main startup class file is in the jar file you can run it using the following command

java -jar <main class name>


Thanks,<br />Premil<br /> <br />SCJP 1.4
Premil Jacob
Ranch Hand

Joined: Sep 10, 2004
Posts: 30
sorry i missed out the jar file name before

its
java -jar <jar file name> <main class name>
Surasak Leenapongpanit
Ranch Hand

Joined: May 10, 2002
Posts: 341
See The Extension Mechanism.
 
GeeCON Prague 2014
 
subject: Can't find ..\lib\ext\ packages