JAVA_HOME DOES NOT POINT TO THE JDK

Ashish Pandey

Total Post:128

Points:898
Posted by  Ashish Pandey
Java 
 705  View(s)
Ratings:
Rate this:
I am trying to follow a tutorial about how to use ant to build and run your application. I've followed all the steps and have created the build file, but when I try to run ant it gives me this error.

BUILD FAILED /home/bilal/tmp/ant/build.xml:19: 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 "/usr/lib/jvm/java-6-openjdk/jre"

Any ideas how to resolve this issue ?
  1. Mayank Tripathi

    Post:397

    Points:3117
    Re: JAVA_HOME does not point to the JDK

    Make JAVA_HOME variable point to a jdk installation, not jre.

    You are referencing the runtime environment, not the development kit - it can't find the compiler because its not there.

    From the line you posted, which states you have open-jdk you can just remove the jre at end:

    export JAVA_HOME='/usr/lib/jvm/java-6-openjdk/'

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!