File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes IDEs, Version Control and other tools and the fly likes JAVA_HOME  ,CLASSPATH ,& PATH Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Engineering » IDEs, Version Control and other tools
Bookmark "JAVA_HOME  ,CLASSPATH ,& PATH" Watch "JAVA_HOME  ,CLASSPATH ,& PATH" New topic
Author

JAVA_HOME ,CLASSPATH ,& PATH

Lucky J Verma
Ranch Hand

Joined: Apr 11, 2007
Posts: 278
I am comfused what is the exact difference between PATH,CLASSPATH, & JAVA_HOME environmental variables.

i knew ,for javac to work we set classpath ,but now i read ,we need to work on java_home aftere JDK installation.


Do these variables have any existence out of JVM.Means if machine doesnt have JAVA, then only PATH system vairable exists?
Amit M Tank
Ranch Hand

Joined: Mar 28, 2004
Posts: 257
path is the place where you define all your executables. So if you have installed java or any other application you might want to edit the path variable.

classpath is the variable where you put all your jars and classes. When you invoke java or javac it uses the classpath variables to load the dependent classes.

JAVA_HOME - this variable is used by lot of application like weblogic, Ant etc. Most of these applications uses JAVA_HOME so as to call java.exe or javac.exe

Hope this helps


Amit Tank
Linked In
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16305
    
  21

Originally posted by Lucky J Verma:


Do these variables have any existence out of JVM.Means if machine doesnt have JAVA, then only PATH system vairable exists?


Even if Java is installed, you may not have definitions for CLASSPATH and JAVA_HOME - they're optional and usually you set them in your login script (.bashrc or whatever). Although some products such as Eclipse and Weblogic server require setting up a JAVA_HOME in order to know where the JVM you want to use is located.


Customer surveys are for companies who didn't pay proper attention to begin with.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JAVA_HOME ,CLASSPATH ,& PATH