Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes Beginning Java and the fly likes setting path variable Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "setting path variable" Watch "setting path variable" New topic
Author

setting path variable

Jimmian Lin
Greenhorn

Joined: May 31, 2008
Posts: 16
Hi

I am trying to set a path variable to the bin directory in the new Java folder I installed. However, my command prompt is still not recognizing the javac command outside of the bin folder. I double checked the path that I typed C:\Program Files.... etc and it seems to match precisely, down to the spaces and the capital letters, but the window still does not understand javac. Does anyone have any suggestions?

Thanks
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 10386
    
    8

Check this out
http://faq.javaranch.com/java/HowToSetTheClasspath


[How to ask questions] [Donate a pint, save a life!] [Onff-turn it on!]
Jimmian Lin
Greenhorn

Joined: May 31, 2008
Posts: 16
I only saw a path variable, but no class path variable for some reason. So, should I be typing in the path variable the directory where my files are located instead of the bin directory?
Jimmian Lin
Greenhorn

Joined: May 31, 2008
Posts: 16
Scratch the last message. I should be setting the class path variable to the folder containing my java files in addition to setting the path variable to the bin files?
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 10386
    
    8

My bad! Confused path for classpath.
Path is for the java.exe and javac.exe.

The folder where your class files are should be on the class path.
By default the current directory is already on the class path.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38896
    
  23
Don't set the CLASSPATH at all.
 
Consider Paul's rocket mass heater.
 
subject: setting path variable