Reputation: 343
I installed ant in my system, when I run ant
command, I get following error:
Error: JAVA_HOME is not defined correctly. We cannot execute /usr/lib/jvm/java-6-sun/bin/bin/java
Please suggest what should I do?
Upvotes: 0
Views: 62
Reputation: 469
In your Java installation directory, u can see a jre subdirectory that contains the bin directory that contains java and related executables.
So you should probably be setting JAVA_HOME to /usr/lib/jvm/jdk/jre rather than /usr/lib/jvm/jdk.
Upvotes: -1
Reputation: 206946
Set the environment variable JAVA_HOME
to the installation directory of your JDK, which is: /usr/lib/jvm/java-6-sun
It looks like you have set it to /usr/lib/jvm/java-6-sun/bin
(note the /bin
at the end); the ant
command appends another /bin
so that you get .../bin/bin/java
which is incorrect.
Upvotes: 2