I have recently started working with Java(FX), and have been trying to create a jar file. I have been doing this with the build.fxbuild tool in eclipse. For some reason, after I fill out the vendor name, app title, and version, I try to run the ant builder, and I get an error that says JAVA_HOME is set to C:\Program Files\Java\jre-10.0.2, and I need it to be set to the jdk that I have installed. I have been trying to get eclipse to get :

BUILD FAILED C:\Users\lazza\eclipse-workspace\YOooo\build\build.xml:53: Unable to find a javac compiler; com.sun.tools.javac.Main is not on the classpath. Perhaps JAVA_HOME does not point to the JDK. It is currently set to "C:\Program Files\Java\jre-10.0.2" I assume that I need to set my JAVA_HOME to the right place, but I cannot find out how to set it. I have gone through my computer preferences to set JAVA_HOME and gone through CMD to see if it was recognized properly and it is, but eclipse still throws the same errors. If anyone could help me out it would be much appreciated.

1 Answer 1


JAVA_HOME is an environment variable that you can access by pressing the Windows button on your keyboard, type "Environ" to bring up the links to the Environment Variables, click Open then select the button that says Environment Variables... . There are two panels. The upper allows you to set variables for you as a single user. The lower allows you to set variables for all users on your computer.

Look for a variable called JAVA_HOME and ensure that its value is the Java SDK folder called bin for example C:\Program Files\Java\jdk-11.0.2

Not the jre which is the runtime

  • Correction: the JAVA_HOME value should be the Java JDK folder. The bin is inserted in the Path variable.
    – githekojm
    Jun 10, 2019 at 17:04
  • 1
    There's an Edit button below your posts you should use to update and correct them. Jun 10, 2019 at 17:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.