Sunday, June 11, 2017

Installing Java on Ubuntu using APT

The Oracle JDK is the official JDK; however, it is not provided as default installation for Ubuntu.

You can install the oracle JDK using apt-get, following the next steps:

Add a custom repository:


sudo apt-get install python-software-properties
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
Install the latest jdk version:


sudo apt-get install oracle-javaX-installer
Note: Replace X with the version number.

Update the current default version:


sudo update-alternatives --config java
sudo update-alternatives --config javac
Update your java home path:


sudo nano /etc/environment
JAVA_HOME="YOUR_PATH"
source /etc/environment
echo $JAVA_HOME
Note: Use the path displayed while updating alternatives.

I wish that I can help someone.

No comments:

Post a Comment