Wednesday, December 1, 2021

How to install Eclipse IDE and Java on Ubuntu and Linux Mint.

Eclipse is an Integrated development environment (IDE) tool primarily used by Java developer. It can also be used for other programming languages such as C++, JavaScript, PHP, Python etc. adding plugins. Eclipse foundation who maintains it's development. In this guide, will see simple steps to install Eclipse and Java on Ubuntu Linux same steps can be used in Linux Mint.

Prerequisites

1. Ubuntu/Linux Mint OS installed instance
2. Java
Java Runtime Environment (JRE) - As name suggests, JRE contains the class libraries, loader class and JVM to run or execute Java program
Java Development Kit (JDK) - JDK is used to develop and run Java program which includes JRE, compliers, debuggers and other tools needed for Java development. All JDK versions comes bundled  with Java Runtime Environment (JRE), no need to download separately.
In short, if you want to run a Java application, only need a JRE which includes a JVM and if you are a developer looking to program in Java, you need a JDK which includes JRE libraries & JVM.
Execute below command to find whether Java is already installed or not. 
$ java -version
Above snippet depicts that there is no Java is installed.

Installing default JRE/JDK

First update you system with below command:
$ sudo apt update
Execute the following command to install Java Runtime Environment (JRE) and .
$ sudo apt install default-jre
Verify the installation with the following command:
$ java -version
Execute the following command to install Java Development Kit (JDK)
$ sudo apt install default-jdk
Verify the installation with the following command:
$ javac -version

How to find if JRE or JDK is installed on system:

Open terminal or command prompt and execute the following command:
$ java -version // this will check JRE version
$ javac -version // this will check java complier version.

Install Specific Version of OpenJDK

If you want to install specific version of OpenJDK, open terminal and execute the following command. Below command to install OpenJDK 8.
$ sudo apt install openjdk-8-jdk

Managing Java

If you have multiple java is installed on single server, you can configure the default version using below command.
$ sudo update-alternatives --config java
Type selection number and press  enter key, this will change the default java.

Eclipse IDE installation

Install it via terminal or command prompt, open terminal and type following command.
$ sudo snap install eclipse --classic
Following output should be seen on successful installation of Eclipse IDE.

Starting Eclipse IDE

Eclipse is installed now, go to activity and search eclipse and click on icon as shown below.
Below screen will be shown when you start eclipse for the first time, click on Lunch button.

Conclusion

We have seen how to install Eclipse IDE and Java on Ubuntu Linux. To know more about and get started with Eclipse visit Eclipse documentation page.

No comments:

Post a Comment

Please do not enter any spam link in the comment box.