• 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

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

 
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Sheriff
Posts: 9109
12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
reply
    Bookmark Topic Watch Topic
  • New Topic