user1673206
user1673206

Reputation: 1711

Eclipse can't find the JRE

I'm having a problem with the JRE on Ubuntu 14.04.

EDIT: the computer has no connection to Internet, so I'm using the apt-offline method (I did that already with the installation of eclipse).

Im trying to run eclipse cdt, when I play it, I get this 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: /usr/lib/eclipse/jre/bin/java java in your current PATH

the java --version command gave me that output:

The program 'java' can be found in the following packages:
 * default-jre
 * gcj-4.8-jre-headless
 * openjdk-7-jre-headless
 * gcj-4.6-jre-headless
 * openjdk-6-jre-headless
Try: sudo apt-get install <selected package>

So I understand that the JRE not installed yet, so I installed it:

sudo apt-get install openjdk-7-jre-headless

and that is the output:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
openjdk-7-jre-headless is already the newest version.
openjdk-7-jre-headless set to manually installed.
0 upgraded, 0 newly installed, 0 to remove and 7 not upgraded.

after java --version command, the output is again like the previous output.

I tried to read this and that and some more articles

EDIT 2: I also tried to add the path usr/lib/jvm/java-7-openjdk-amd64 to the etc/profile file:

JAVA_HOME=/usr/local/java/jre1.8.0_60
PATH=$PATH:$HOME/bin:$JAVA_HOME/bin
export JAVA_HOME
export PATH

I don't understand what I am missing or doing wrong. Or maybe the JRE is installed but Eclipse doesn't know it somehow?

I will be very happy for some guidance.

Upvotes: 1

Views: 4031

Answers (3)

Ravinath Edirisinghe
Ravinath Edirisinghe

Reputation: 75

Just copy the "jre" folder from jdk and paset it inside "eclipse" folder

Upvotes: -1

bottom
bottom

Reputation: 1

try to add the java path in the ~/.bashrc.

Upvotes: -1

Matthias J. Sax
Matthias J. Sax

Reputation: 62350

Install via

sudo apt-get install openjdk-7-jdk 

You might also add the JDK manually to Eclipse:

Windows -> Preferences
=> Java / Installed JREs

If it is not listed, click "Add", choose "Standard VM", and click "Next". Set "JRE Home" as something like /usr/lib/jvm/java-7-openjdk-amd64 (navigate via "Directroy" button).

Upvotes: 3

Related Questions