Installing oracle java on Linux with latest tar file
suggest changeFollow these steps to install Oracle JDK 8 update 112 from its tar archive. A later 8 update uses the same steps with that update’s file and directory names.
- Download the 8u112 tar file from here.
- You need sudo privileges:
sudo su
- Create a dir for jdk install:
mkdir /opt/jdk
- Extract downloaded tar into it:
tar -zxf jdk-8u112-linux-x64.tar.gz -C /opt/jdk
- Verify if the files are extracted:
ls /opt/jdk
- Setting Oracle JDK as the default JVM:
update-alternatives --install /usr/bin/java java /opt/jdk/jdk1.8.0_112/bin/java 100
and
update-alternatives --install /usr/bin/javac javac /opt/jdk/jdk1.8.0_112/bin/javac 100
- Check Java version:
java -version
Expected output:
The first line reports the update that was installed:
java version "1.8.0_112"
The remaining lines name the runtime build and the HotSpot VM. The exact build number depends on the downloaded archive.
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents