This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

how to set java env variables  RSS feed

nancy andrew
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

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;

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
fred rosenberger
lowercase baba
Posts: 12542
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
Jesper de Jong
Java Cowboy
Posts: 16028
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!