• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Ranch Hand
Posts: 3061
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If ur main startup class file is in the jar file you can run it using the following command

java -jar <main class name>
 
Premil Jacob
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
sorry i missed out the jar file name before

its
java -jar <jar file name> <main class name>
 
Ranch Hand
Posts: 341
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
See The Extension Mechanism.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic