The first step is to install Java Development Kit (JDK) (you can however download Java SE Development Kit 8 from http://www.oracle.com/technetwork/java/ ... 33151.html):
Open the Terminal and add the Launchpad PPA (Personal Package Archive) repository into your system:
Code: Select all
sudo add-apt-repository ppa:webupd8team/java
Update your system packages
Code: Select all
sudo apt-get update
Code: Select all
sudo apt-get install oracle-java8-installer
Set the default Java by running:
Code: Select all
sudo apt-get install oracle-java8-set-default
Code: Select all
java -version
Code: Select all
java version "1.8.0_121"
Java(TM) SE Runtime Environment (build 1.8.0_121-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.121-b13, mixed mode)
Download Eclipse from Friends of Eclipse Mirror or elsewhere.
Unpack the tar.gz file by the tar command:
Code: Select all
tar -xvzf eclipse-inst-linux64 .tar.gz
Open the unpacked folder (eclipse-installer), look for the executable file named "eclipse-inst", right click on it and then choose Run. You will see the wizard prompt, then select the item to install, the installation folder, and finally click Install button. In my case I selected the first item in the list:
"Eclipse IDE for Java Developers
The essential tools for any Java developer, including a Java IDE, a Git client, XML Editor, Mylyn, Maven and Gradle integration."
Next, accept the Eclipse Foundation Software User Agreement, and Eclipse installation will start.
If successfully installed, then click LAUNCH to launch Eclipse and to create a working directory.
Finally create a launcher shortcut by copying and pasting the following
Code: Select all
gedit .local/share/applications/eclipse.desktop
- [Desktop Entry]
- Version=Neon
- Name=Eclipse
- Comment=Eclipse is an IDE
- Exec=/home/USERNAME/java-neon/eclipse/eclipse
- Path=/home/USERNAME/java-neon/eclipse/
- Icon=/home/USERNAME/java-neon/eclipse/icon.xpm
- Terminal=false
- Type=Application
- Categories=Utility;Application;Development;
By default Eclipse is installed in /home/USERNAME/eclipse/java-neon/eclipse in my case. So change java-neon and USERNAME accordingly depending on your installation path.
Desktop launcher is not such important to Linux-based distribution users because they like to start almost everything from the Terminal. So in order to access eclipse from Terminal, we have to add it to the PATH variable as follows:
- Open ~/.bashrc with your favorite text editor
- Add export PATH="/home/USERNAME/eclipse/java-neon/eclipse/eclipse:$PATH" (remember to replace USERNAME)
- Save and exit
- Execute source ~/.bashrc in Terminal
- You can now always start eclipse from Terminal by simply typing "eclipse" and hit Enter
I have tested my installation with the "HelloWorld" Java program: