A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Win a copy of
Spring in Action
this week in the
how to set java env variables
Joined: Jan 19, 2010
Jun 24, 2011 10:28:03
Please let me know what will be the value of PATH, CLASSPATH and JAVA_HOME in environment variables.
Currently i have set:
PATH = C:\Program Files\Java\jdk1.5.0_09\bin;
JAVA_HOME = C:\Program Files\Java\jdk1.5.0_09;
CLASSPATH = ?
I remember that somethin is set uptill C:\Program Files\Java\jdk1.5.0_09\lib\tools.jar;
I dont know what is that. Kindly tell me what will be the classpath and where to set tools.jar
Joined: Oct 02, 2003
Jun 24, 2011 10:42:43
I don't think we can answer all that. Environment variables are custom to your own setup. However...
Most folks here would recommend beginners DON'T set a CLASSPATH variable at all. It should not exist.
Your PATH should have lots of directories in it, most likely. Mine looks like this:
C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\Common Files\Lenovo;C:\Program Files\Lenovo\Client Security Solution;c:\Program Files\Altiris\Software Virtualization Agent\;C:\Novell\GroupWise;C:\Program Files\Common Files\Ulead Systems\MPEG;C:\strawberry\c\bin;C:\strawberry\perl\site\bin;C:\strawberry\perl\bin;C:\Program Files\Java\jdk1.6.0_23\bin;C:/Python27
it contains the directories for programs you frequently run.
And I don't have a 'java_home' set on my machine.
There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
Jesper de Jong
Joined: Aug 16, 2005
Jun 24, 2011 11:41:11
tools.jar does not need to be added to any environment variable.
PATH is for the operating system, so that it knows where to find executables such as the Java compiler (javac.exe) and other tools that are in the bin directory of the JDK.
CLASSPATH is for Java, it contains the directories and JAR files that it should search for *.class files. You normally do not need to set this.
JAVA_HOME is not necessary for Java. Some programs use this to find the directory where the JDK is installed, but unless you have a program that needs this, you do not need to set it.
So the only thing you really need to do is add the bin directory of the JDK to your PATH variable, but you already seem to have done this.
Java Beginners FAQ
JavaRanch SCJP FAQ
The Java Tutorial
Java SE 8 API documentation
rocket mass heater
subject: how to set java env variables
some problem with variable config
run java code through bat file
Stumbling Block at the beginning
error:package javax.servlet does not exists
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2014