In order to install Java on your ubuntu, I assume you are working from home directory
cd ~ or
cd $HOME which in my case is
"/home/omar" or use
sudo su - to switch to root user and avoid typing sudo everytime you need root privilege.
To start, open a new terminal
Ctrl+Alt+T and run the following command:
then run the command below to find JDK installation directory:
Afterward, open the startup script file
vim ~/.bashrc and add the following lines in the bottom:
then run the following command to activate the new path settings immediately:
Now that you have java installed, go to Eclipse IDE
download page: https://www.eclipse.org/downloads/download.php?file=/oomph/epp/2020-06/R/eclipse-inst-linux64.tar.gz
and download the Eclipse installer archive. Once downloaded, extract the archive content by running the command below:
After extracting the installer, open
vim ~/eclipse-installer/eclipse-inst.ini file and append the following configuration:
then launch the installer:
cd ~/eclipse-installer/ && ./eclipse-inst and choose Eclipse IDE for Enterprise Java Developers. Once you have Eclipse installed, open its configuration file
vim ~/eclipse/jee-2020-06/eclipse/eclipse.ini and add the following:
now, create a shortcut for eclipse by creating a new file
vim ~/eclipse.desktop and inserting the following content into it:
then install the shortcut:
That's it, congratulation! from now on you can find your Eclipse among Ubuntu applications.
Bonus:
You can also install Lombok utility within eclipse; all you have to do is go to
Lombok download page: https://projectlombok.org/download
and download the jar. Once the jar downloaded, launch it by running
java -jar lombok.jar and specify the eclipse.ini file location
/home/omar/eclipse/jee-2020-06/eclipse/eclipse.ini