Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Eclipse cannot find Java on Ubuntu

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.

enter image description here

like image 907
siva636 Avatar asked May 27 '12 14:05

siva636


2 Answers

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.)

like image 84
Stephen C Avatar answered Oct 31 '22 06:10

Stephen C


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.

like image 26
Kazekage Gaara Avatar answered Oct 31 '22 06:10

Kazekage Gaara