Java is properly installed in my Ubuntu 12.04 and the PATH variable is set in the .bashrc
file.
The command java -version
gives an expected output.
But when I try to start Eclipse, it complains as JDK not found.
It looks to me like you have set the PATH environment in your shell, but you are launching Eclipse using some menu item or shortcut, and the context is using a different PATH.
One option is to change the eclipse.ini file as other answers say.
Another option is to try to figure out why Eclipse is being launched with a different PATH to the one in your command path. (The "fix" might simply be to logout and login again to make the launcher pick up the updated PATH setting. Or launcher may be picking up the incorrect PATH setting from somewhere else.)
You might need to edit your eclipse.ini
file and mention the path there. Read this for more details.
EDIT:
-vm
/opt/sun-jdk-1.6.0.02/bin/java
This is how your vm argument should be in the .ini file. If not,change it. Be careful about the path though. Generally Java is installed in /opt,but check once on your system.
Also, look at this question as well.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With