Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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 Oct 7 '10 at 12:20

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

2 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

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

share|improve this answer

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

For windows:

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


REM this will give you trouble soon enough ;)

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

Define that in the environment variables.

share|improve this answer

You must log in to answer this question.