Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

[solved]Adding classes to PATH in windows

 
Cody Long
Ranch Hand
Posts: 95
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using BlueJ to write my Java code for school, and the provided me with a bunch of classes I need to use. To link the packages to BlueJ is easy, but i wanted to know how to add them to my PATH. I tried to just go to the PATH variable in Environment Variables but when i tried to compile a class that used one of the classes that i need to add to the PATH it gave me an error that it could not find the specified classes. I am using XP Pro SP3
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You don't put classes on the PATH, but on the CLASSPATH. Either set the the root package of your classes to the CLASSPATH environment variable, or use the "-classpath" flag on the javac command line.
 
Cody Long
Ranch Hand
Posts: 95
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Oh. That makes sense. Thank you.
 
Vishal Kashyap
Ranch Hand
Posts: 73
BSD C++ Fedora
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear Cody,
please try to put all classes in the same package and the try to add path to this package to your CLASSPATH environment variable in your XP. then after restarting your BlueJ try once again to compile it. I am sure that it will compile.
 
Cody Long
Ranch Hand
Posts: 95
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I added the classes to my CLASSPATH and it worked. Thanks all for your help!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic