Hot questions for Using Ubuntu in jakarta ee

Top Java Programmings / Ubuntu / jakarta ee

Question:

When I open eclipse in Ubuntu it is showing the 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:
/opt/eclipse/jre/bin/java
java in your current PATH

These are the Environment variables I set in .bashrc file:

JAVA_HOME=/opt/jdk1.7.0
PATH=$PATH:$HOME/bin:$JAVA_HOME/bin
JRE_HOME=/opt/jdk1.7.0
PATH=$PATH:$HOME/bin:$JRE_HOME/bin
export JAVA_HOME
export JRE_HOME
export PATH

I have also checked in terminal:

asr@asr-desktop:~$ java -version

java version "1.7.0"
Java(TM) SE Runtime Environment (build 1.7.0-b147)
Java HotSpot(TM) Server VM (build 21.0-b17, mixed mode)

asr@asr-desktop:~$ which java

/opt/jdk1.7.0/bin/java

asr@asr-desktop:~$ echo $JAVA_HOME

/opt/jdk1.7.0

asr@asr-desktop:~$ echo $PATH

/opt/softwares/apache-ant-1.7.1/bin:/usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/home/vidyayugpc/bin:/opt/jdk1.7.0/bin:/home/vidyayugpc/bin:/opt/jdk1.7.0/bin

The eclipse is opening via command prompt only, I have tried to specify JVM location in eclipse.ini file by adding the below line

-vm

/opt/jdk1.7.0/bin/java

But its not running again showing the same error jvm is not found.Can any one help me here?


Answer:

This work for me edit the eclipse.ini using any text editor and change your -vm path to real path of your JDK

-vm /opt/jdk1.6.0/bin/