Forums Register Login

JAVA_HOME variable

+Pie Number of slices to send: Send
When I install jdk, it automatically installs "c:\ program Files\java\jre6\bin\java"
Now I am setting environment variable Path with the value of "C:\program files\java\jre6\bin\java"
If I am setting path variable like this, do I still need to set up JAVA_HOME variable ? or if I am setting up JAVA_HOME variable as an environment variable, do I need to set up Path variable for java bin file ?
Do I setup path variable for java compiler (javac) or java executable (java) ? I was tyrying to look for javac in "c:\ program Files\java\jre6\lib\bin" , but I could not find bin folder within lib folder. javac is not within lib folder either. So where is javac located ?
+Pie Number of slices to send: Send
It never goes into that folder when I install it on Windows. While we are at it, please read this FAQ because you have given two different locations. I suspect, if you are installing into a jre folder, that you have downloaded the wrong thing. Remember you need a JDK, not a JRE, to create Java™ programs.
+Pie Number of slices to send: Send
I just did fresh installation for java and its installed in following dir
C:\Users\Jignesh\AppData\LocalLow\Sun\Java\jdk1.6.0_20

exe file is located in the following location
C:\Users\Jignesh\AppData\LocalLow\Sun\Java\jre1.6.0_22_x64\bin

1) This installation did not install jdk, it only installed jre1.6. Why does it not install jdk ? I did not see any option to install jdk or jre, there was only one option available.Before, there were options to install jdk or jre. Does it mean that we dont need jdk anymore ? If its required, how to install it ?
2) Where is javac located ?
3) if I have to specify JAVA_HOME, it will be JAVA_HOME=C:\Users\Jignesh\AppData\LocalLow\Sun\Java\jdk1.6.0_20. What is the need of specifying JAVA_HOME, if I am already specifying PATH and CLASSPATH ? If its not specified, does it give any issues ? Or is it only for the reference purpose ?
+Pie Number of slices to send: Send
That's not the default install folder. If you customize the folder during installation, you'd better know exactly what you're doing or you'll end up with a JRE install that overwrites the JDK install -- and no javac.exe.
+Pie Number of slices to send: Send
As Darryl Burke suggests, you have installed your JDK in an unusual location. You should add that location to your system PATH, before any other Java™ locations. This FAQ reminds you how to set your system PATH.
+Pie Number of slices to send: Send
 

nirjari patel wrote:. . . Why does it not install jdk ? . . .

Did you download a JDK installer? Look here, and make sure to download a JDK.
Have you set your PATH to include that directory?
Specifying JAVA_HOME makes it easier to update PATH entries; see the FAQ I posted earlier.
She still doesn't approve of my superhero lifestyle. Or this shameless plug:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 2192 times.
Similar Threads
Class file not getting created
Problem starting TOMCAT version 5
Setting the classpath
Java environment variable and path setting
JAVA_HOME does not point to the JDK
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 02:59:50.