Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Setting up eclipse on ubuntu

I have a small problem with Eclipse on my Ubuntu machine. I installed JDK, set JAVA_HOME and PATH variables, all seems correct, but eclipse refuses to launch and throws an 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

have no clue what's the problem. help please.

note:

I am able to run java and javac in terminal.

like image 727
Headshota Avatar asked Oct 19 '11 20:10

Headshota


People also ask

How do I start Eclipse in Ubuntu?

Eclipse InstallationVisit official site of eclipse http://www.eclipse.org and download a zip folder. After downloading, locate to the download folder and extract folder. Use the following command to extract folder. Move Eclipse to /opt/ directory.

Can I use Eclipse on Ubuntu?

If the first method of above is not what you want, you can manually download Eclipse installer and install the package. Eclipse has its installer you can use to install it on Ubuntu Linux. First, go to the link below to download the installer. At the time of this post, the current version is 2021-09.


3 Answers

If you get this error even though you already have JDK in your system-just follow this steps:

1)open eclipse.ini file with text editor.
2)copy your jdk path by using -vm command (vm and your path should not be in same line)
eg:
-vm        
/usr/lib/java/jdk1.7.0_75/jre/bin/java 
3)-vm should be placed before -vmargs in eclipse.ini file.

99% works if you follow above simple steps

like image 158
Nagendra Reddy Avatar answered Oct 14 '22 12:10

Nagendra Reddy


This worked for me:

ubuntu:~$ sudo apt-get install default-jre
like image 11
Craig Hawkins Avatar answered Oct 14 '22 12:10

Craig Hawkins


You need to create a link at /usr/bin/java for the java binary (wherever you have placed it).

sudo ln -s /path/to/jre*/bin/java /usr/bin/java
like image 4
BZ1 Avatar answered Oct 14 '22 14:10

BZ1