• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

java-execution only works if CLASSPATH is empty - why???

 
Robert Jaeger
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!
This is a weired thing.
If I set
CLASSPATH j2sdk1.4.0_01\lib\tools.jar
the execution of test.class (which I successfully compiled from test.java) doesn�t work (The class cannot be found!)
If I leave the CLASSPATH empty, it works!!!
That is weired.
Unfortunately I want to add jdom.jar to my classpath, if I do that the execution of test.class doesn�t work anymore.
Another problem/question: Where do I have to put jdom.jar that it can be found? I put it in c:/j2sdk1.4.0_01/lib, but during compilation the packages that shoud be imported cannot be found.
Weired, too!
Someone can help me?
 
Marilyn de Queiroz
Sheriff
Posts: 9067
12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Set your classpath to the subdirectory that contains your class after you compiled it with javac.

So if you have a subdir like C:\java that contains MyClass.java and you compile it with

javac MyClass.java

then you now have C:\java\MyClass.java and C:\java\MyClass.class

Your classpath should include C:\java

You can add a jar file to C:\j2sdk1.4.0_01\jre\lib\ext
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic