Reputation: 55
I know there are lots of questions and answers about this but none of them are working. I am on a Windows 7 Computer.
I have set my JAVA_HOME in Environment Variables but I keep on getting errors. I have set it to
"C:\Program Files\java\jdkxxx\"
(xxx = Java Version) I have tried setting it without quotes and it still doesn't work. I get the error
ERROR: JAVA_HOME variable is set to an invalid directory: C:\Program Files\java\java1.7.0_21\ Please set the JAVA_HOME variable in your environment to match the location of your Java installation.
Upvotes: 1
Views: 661
Reputation: 125
1. Navigate to C:/Program Files/Java Look for any JDK folders and find the last version if you don't have any of them then Download and install from Java official website HERE
2. On your Desktop, right-click on My Computer and open Properties From the left side choose Advanced system settings
3. At the bottom of the window, press the Environment variables button. Now we got to add the variable in the both: User and System variable boxes.
4. Click New button at the User variables box and write: Variable name: JAVA_HOME Variable value: C:/Progra~1/Java/jdk-folders-name NOTE: use Progra~1 for Windows x64 and Progra~2 for Windows x32 Then press OK
5. Do the same for the System variables box
6. Press Ok till you close all the windows and run again your Soft.
Or check this video tutorial: https://www.youtube.com/watch?v=47K3gBla76o
Upvotes: 0
Reputation: 104474
Take out the trailing backslash and remove the quotes
set JAVA_HOME=C:\Program Files\java\java1.7.0_21
Upvotes: 2