Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Ive been following all the steps to set up java and its compilers and sutch, but i get to the step to change the route for JAVA_HOME where i go into enviroment variables and there is no JAVA_HOME, i have installed everything needed, I have windows 7 if that changes anything, whats going on, thanks x

share|improve this question

migrated from stackoverflow.com Oct 7 '10 at 12:20

This question came from our site for professional and enthusiast programmers.

2  
    
@org.life.java I wouldn't agree more with you on this duplicate if the question wasn't "how to update the JAVA_HOME (as probably asked in the tutorial the OP is following) if it doesn't already exist". –  Colin HEBERT Oct 7 '10 at 11:03
add comment

4 Answers

You have to define your %JAVA_HOME% yourself, create the variable if it doesn't exist.

share|improve this answer
add comment

You need to set the JAVA_HOME variable in your Environment variables.

Be sure to set it to the root of your JDK folder.

e.g. C:\Program Files\Java\jdk1.6.0_16\

For some reasons my comments are not showing up. The command window does not pick up changes to the environment variables dynamically, be sure to open a new command window after you have made the change.

share|improve this answer
    
cmd still doesnt understand javac why? –  luke Oct 7 '10 at 11:03
    
@luke - add %JAVA_HOME%\bin to your path –  Hobo Oct 7 '10 at 11:12
    
+1 for mentioning need of restarting the command window. –  s.d Nov 19 '12 at 10:03
add comment

For windows:

REM Set to whatever JDK is installed to:
set JAVA_HOME="C:\Program Files\Java\jdk1.6.0_16\"

set PATH=%JAVA_HOME%/bin;%PATH%

REM this will give you trouble soon enough ;)
set CLASSPATH=.;%CLASSPATH%

Another option is to get an IDE like Eclipse or NetBeans. They will do most of it for you.

share|improve this answer
    
Where can I add this to Windows 7, so that it is set on boot. (I'm new to Windows, having used Unix for a couple of decades). –  chrisdew Jun 26 '12 at 8:50
add comment

Define that in the environment variables.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.