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 i
First of all you need to set your JAVA path in .bashrc file.
goto cd ~
open .bashrc,vi .bashrc
add a line at the end export path="path/to dir:$path"
do source .bashrc
for changes to take effect.
Then open your eclipse.ini file(if you want to locate eclipse.ini do whereis eclipse
).
open eclipse.ini,then add a line
-vm
"path/to/bin/of/open-jdk"
You need to add the JDK to your PATH.
This link should help you get started.
I solved this error message by adding jre path in to eclipse.ini.To solve the error like this,your machine should have java installed.
In my setup eclipse.ini is in
eclipse-jee-mars-linux-gtk-x86_64-5.0.0/eclipse
folder.
Add,
-vm /home/user/Documents/Softwares/jdk-8u202-linux-x64/jdk1.8.0_202/jre/bin
at the top of the file.
In here /home/user/Documents/Softwares/jdk-8u202-linux-x64/jdk1.8.0_202
is my JAVA_HOME
For me, directing JDK path to -vm
didn't work.I had to put the jre/bin path which is inside jdk folder.
I tried editing .profile, .bashrc, to no avail. (I'm trying to use eclipse by clicking an icon, NOT by executing it from a bash shell).
SOLUTION: I copied my /home/denise/jdk1.7.0_25/jre to /home/denise/dev//jre
which is a stupid solution because it defeats the purpose of having a .profile or .bashrc.
and no, there was no .pam_environment file
peace!
You need to have a Java environment that can execute the Java instructions in Eclipse for it to run.
Install a suitable Java package in the package manager, and try again. Note that Eclipse does not require a JDK, a JRE is enough.