HOW TO INSTALL JAVA IN UBUNTU

Follow the steps to successfully install default JRE and default JDK in your Ubuntu

To check if Java is already installed:

java –version

1

If the above command returns “The program java can be found in the following packages”, then it means that Java hasn’t been installed, so execute the following command:

sudo apt-get update

sudo apt-get install default-jre

2

When prompted hit y, the installer installs jre.

To install the Java Development Kit (JDK), which is needed to compile Java applications execute the following command:

sudo apt-get install default-jdk

3

Hit y and continue..

Now check the version of Java installed.

To make sure that you are running the correct version of Java, execute the following and set your preference.

sudo update-alternatives –config java

10

For example, if you need default jdk, type 1 and press enter.

Advertisements

2 thoughts on “HOW TO INSTALL JAVA IN UBUNTU

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s