problem running eclipse on ubuntu?

Posted on May 9, 2023

Question

I downloaded eclipse on ubuntu. But when I run it it show following error.

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/awan/eclipse/jre/bin/java
java in your current PATH

Can someone help me to solve this. I don't have experience about this on ubuntu.

thanks

Answer

You need to install either the openjdk-7-jre or oracle-java7-jre package.

sudo apt-get install openjdk-7-jre

Note that openjdk-7-jre is easier to install, because it's available via the standard Ubuntu repository, whereas you have to build oracle-java7-jre yourself using java-package.