Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can Eclipse find JDK in Linux?

I've installed Eclipse and jdk manually. My JAVA_HOME is set, and I am able to run the java -version and javac -version commands, but when I try to run Eclipse, it shows the following message:

A Java Runtime Environment (JRE) or Java Development Kit (JDK)
must be available in order to run Eclipse. No Java virtual machine
was found after searching the following locations:
/home/$USER/development/eclipse/jre/bin/java
java in your current PATH

How can I fix this?

Distro:

Ubuntu 12.0.4 64 bits.

Java:

java version "1.6.0_45"
Java(TM) SE Runtime Environment (build 1.6.0_45-b06)
Java HotSpot(TM) 64-Bit Server VM (build 20.45-b01, mixed mode)

$JAVA_HOME:

/usr/lib/jvm/jdk1.6.0_45

My $PATH contains the following:

/usr/lib/jvm/jdk1.6.0_45/bin

Thank you for the help

like image 588
androidevil Avatar asked May 30 '13 19:05

androidevil


1 Answers

If Eclipse isn't finding your JRE/JDK or finding the wrong version, add the following two lines to the begining of your eclipse.ini file:

-vm
[your-path-to-java-executable]
like image 72
Konstantin Komissarchik Avatar answered Oct 13 '22 17:10

Konstantin Komissarchik