Thursday, August 11, 2016

How to Install Java In Ubuntu

Which Version of Java to Use?

  • JavaSE 7 supports:
    • eclipse mars
    • JBoss AS 7 with Java EE 6 features
    • Tomcat 7-8 with WebSockets
  • JavaSE 8 supports:
    • eclipse neon
    • JBoss WildFly with Java EE 7 features
    • Tomcat 9 with Java EE 8 features

Java SE Development Kit 7 (JDK-7) Installation

To install Oracle's Java, use PPA personal repositories by WEB UP8. Ubuntu public repositories only support OpenJDK.

Copy and paste the following lines into terminal, one-by-one:

sudo add-apt-repository ppa:webupd8team/java
sudo apt update
sudo apt install oracle-java7-installer

You can check Java installation by issuing the java -version command:

user@host:~$ java -version
java version "1.7.0_80"
Java(TM) SE Runtime Environment (build 1.7.0_80-b15)
Java HotSpot(TM) 64-Bit Server VM (build 24.80-b11, mixed mode)
user@host:~$

Java SE Development Kit 8 (JDK-8) Installation

To install Oracle's Java, use PPA personal repositories by WEB UP8. Ubuntu public repositories only support OpenJDK.

Copy and paste the following lines into terminal, one-by-one:

sudo add-apt-repository ppa:webupd8team/java
sudo apt update
sudo apt install oracle-java8-installer

Do I Have to Set the PATH environment variable ?

It is not required to set the PATH variable to add the Java bin directory to the system path.

No comments :

Post a Comment