aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes shoot me, but answer this Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "shoot me, but answer this" Watch "shoot me, but answer this" New topic
Author

shoot me, but answer this

Hussein Baghdadi
clojure forum advocate
Bartender

Joined: Nov 08, 2003
Posts: 3479

Hi ranchers.
you know that we put the extra Jar files in the ext dir.
I put Jars like : jdom.org, liquidlnf.jar, junit.org
the problem is the JVM is loading every jars in this dir except for the look and feel jars..
in my main class, I wrote:
----------
UIManager.setLookAndFeel("com.birosoft.liquid.LiquidLookAndFeel");
----------
the code is compiling fine, but when running it using the command:
java MajorClass
a ClassNotFoundException: com.birosoft.liquid.LiquidLookAndFeel
is thrown...
and if I wrote the command:
java -cp .;%JAVA_HOME%\jre\lib\ext\liquidlnf.jar MajorClass
the application works fine.
so what is the problem??
is there any problem with the JVM?
as I know, I should not point to the ext dir.
should I reinstall the sdk??
Brian Pipa
Ranch Hand

Joined: Sep 29, 2003
Posts: 299
Why do you feel the need to put jars in the ext directory? I have been programming in Java full-time for about 7 years or so and have NEVER had to put anything in the ext directory. Why not just add jars you need to the classpath dynamically?
java -cp .\somejar.jar;.\someotherjar.jar SomeProgram
Brian


My Java Freeware:<br />MACCC - <a href="http://maccc.pipasoft.com" target="_blank" rel="nofollow">http://maccc.pipasoft.com</a><br />Nator - <a href="http://nator.pipasoft.com" target="_blank" rel="nofollow">http://nator.pipasoft.com</a>
Steve Lovelace
Ranch Hand

Joined: Sep 03, 2003
Posts: 125
"Need"??? The extension mechanism is so-o-o much cleaner than diddling around with the class path. I would also like to know why John had this problem. Does anybody know the answer?


The Inner that is named is not the true Inner.
Brian Pipa
Ranch Hand

Joined: Sep 29, 2003
Posts: 299

"The extension mechanism is so-o-o much cleaner than diddling around with the class path"

I have never had a problem "diddling" with the classpath. The extension method is not clean/user-friendly when you distribute an app. You don't want to tell users to add jars to ther ext directory. This may not be relevant in your case since you may not be distributing your app, but every Java developer needs to understand and use the classpath effectively without adding jars to the ext dir. Just my (un-asked-for) opinion. I'll bow out now so maybe someone can answer your actual question.
Brian
PS - BANG! You've been shot.
[ April 06, 2004: Message edited by: Brian Pipa ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: shoot me, but answer this