Step 1: Download the preferable jdk from oracle web site. Here we will use
jdk version as jdk-8-linux-x64
Step 2: Keep the tar.gz file in a folder of your choice in /home/ directory.
Step 3: Extract the tar.gz file
tar -xvzf jdk-8-linux-x64.tar.gz
Step 4: Create JVM folder in /usr/lib folder like:
sudo mkdir /usr/lib/jvm
Step 5: Move the extracted jdk to the above location like :
sudo mv jdk1.8.0 /usr/lib/jvm/jdk1.8.0
Step 6: Install new java sources in system like:
sudo update-alternatives --install /usr/bin/javac javac /usr/lib/jvm/jdk1.8.0/bin/javac 1
sudo update-alternatives --install /usr/bin/java java /usr/lib/jvm/jdk1.8.0/bin/java 1
sudo update-alternatives --install /usr/bin/javaws javaws /usr/lib/jvm/jdk1.8.0/bin/javaws
Step 7: Choose default Java
sudo update-alternatives --config javac
sudo update-alternatives --config java
sudo update-alternatives --config javaws
Step 8: Check the java version.
java -version
jdk version as jdk-8-linux-x64
Step 2: Keep the tar.gz file in a folder of your choice in /home/ directory.
Step 3: Extract the tar.gz file
tar -xvzf jdk-8-linux-x64.tar.gz
Step 4: Create JVM folder in /usr/lib folder like:
sudo mkdir /usr/lib/jvm
Step 5: Move the extracted jdk to the above location like :
sudo mv jdk1.8.0 /usr/lib/jvm/jdk1.8.0
Step 6: Install new java sources in system like:
sudo update-alternatives --install /usr/bin/javac javac /usr/lib/jvm/jdk1.8.0/bin/javac 1
sudo update-alternatives --install /usr/bin/java java /usr/lib/jvm/jdk1.8.0/bin/java 1
sudo update-alternatives --install /usr/bin/javaws javaws /usr/lib/jvm/jdk1.8.0/bin/javaws
Step 7: Choose default Java
sudo update-alternatives --config javac
sudo update-alternatives --config java
sudo update-alternatives --config javaws
Step 8: Check the java version.
java -version
No comments:
Post a Comment