Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Java by (9.5k points)

I set two environment variables in the ‘system’ of the control panel. I named it JAVA_HOME for both the variables which point to 

 

C:\Sun\SDK\jdk\bin

 

But I get this below error when I run it

 

BUILD FAILED

C:\Users\Derek\Desktop\eclipse\eclipse\glassfish\setup.xml:161: The following error  occurred while executing this line:

C:\Users\Derek\Desktop\eclipse\eclipse\glassfish\setup.xml:141: The following error occurred while executing this line:

C:\Users\Derek\Desktop\eclipse\eclipse\glassfish\setup.xml:137: Please set java.home to a JDK installation

 

Total time: 1 second

C:\Users\Derek\Desktop\eclipse\eclipse\glassfish>lib\ant\bin\ant -f setup.xml

Unable to locate tools.jar. Expected to find it in C:\Program Files\Java\jre6\lib\tools.jar

Buildfile: setup.xml

 

Can anyone tell me how to set JAVA_HOME on windows 7?

1 Answer

0 votes
by (19.7k points)
  1. Get the location of JDK installation directory

C:\Program Files\Java\jdk1.8.0_172

  1. Set JAVA_HOME variable

JAVA_HOME = C:\Program Files\Java\jdk1.8.0_172

  1. Right-click on ‘My Computer’ and select properties. 

  2. Go to Advanced tab, then click the Environment Variables button.

  3. Under System Variables, click New.

  4. Enter the variable name as JAVA_HOME.

  5. Enter the variable value as the installation path for the Java Development Kit as step 2

  6. Click OK.

  7. Click Apply Changes.

 

Browse Categories

...