This week's book giveaway is in the JavaFX forum.
We're giving away four copies of Introducing JavaFX 8 Programming and have Herbert Schildt on-line!
See this thread for details.
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

Win a copy of Introducing JavaFX 8 Programming this week in the JavaFX forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "shoot me, but answer this" Watch "shoot me, but answer this" New topic

shoot me, but answer this

Hussein Baghdadi
clojure forum advocate

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 :, liquidlnf.jar,
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:
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

My Java Freeware:<br />MACCC - <a href="" target="_blank" rel="nofollow"></a><br />Nator - <a href="" target="_blank" rel="nofollow"></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.
PS - BANG! You've been shot.
[ April 06, 2004: Message edited by: Brian Pipa ]
I agree. Here's the link:
subject: shoot me, but answer this
It's not a secret anymore!