• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

how to set java env variables

 
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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;
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
 
lowercase baba
Posts: 13050
67
Chrome Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Java Cowboy
Posts: 16084
88
Android Scala IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Politics n. Poly "many" + ticks "blood sucking insects". Tiny ad:
free, earth-friendly heat - a kickstarter for putting coin in your pocket while saving the earth
https://coderanch.com/t/751654/free-earth-friendly-heat-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic