Thursday, May 14, 2020

How To Install Oracle Java 14 & Java SE Development Kit 14 On Ubuntu 20.04 LTS

 Video Tutorial -https://youtu.be/dCc0BUIzGeY

------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Tutorial On How To Install Oracle Java 14 & Java SE Development Kit 14  & Test Java Installation On Ubuntu 20.04 LTS

Java is a popular programming language created in 1995 and used for developing mobile, web and Desktop Applications among many others.
Java SE Development Kit comprises of a set of tools required by Developers to write, compile, run and debug Java Applications.
Offcial Website -https://www.oracle.com/index.html
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Ubuntu 20.04 LTS                     Hostname - www.yourdomain.com  - ip Address - 192.168.1.10
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
apt update ; apt install -y build-essential net-tools curl git software-properties-common curl gdebi

Visit JDK 14 releases page To download the latest archive.- https://jdk.java.net/14/
curl -O https://download.java.net/java/GA/jdk14/076bab302c7b4508975440c56f6cc26a/36/GPL/openjdk-14_linux-x64_bin.tar.gz
tar xvf openjdk-14_linux-x64_bin.tar.gz
mv jdk-14 /opt/

tee /etc/profile.d/jdk14.sh <<EOF
export JAVA_HOME=/opt/jdk-14
export PATH=\$PATH:\$JAVA_HOME/bin
EOF
source /etc/profile.d/jdk14.sh
echo $JAVA_HOME ; java -version


Java SE Development Kit 14 Download Link - https://www.oracle.com/java/technologies/javase/jdk14-archive-downloads.html

dpkg -i jdk-14.0.1_linux-x64_bin.deb
For any dependency errors, resolve with the command: - apt -f install

cat <<EOF | sudo tee /etc/profile.d/jdk14.sh
export JAVA_HOME=/usr/lib/jvm/jdk-14
export PATH=\$PATH:\$JAVA_HOME/bin
EOF
source /etc/profile.d/jdk14.sh ; java -version

Test Java Installation-
nano HelloWorld.java
public class HelloWorld {

    public static void main(String[] args) {
        // Prints "Hello, World" to the terminal window.
        System.out.println("Hello, World");
    }

}
javac HelloWorld.java
java HelloWorld

------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

No comments:

Post a Comment