How to install a specific version of JAVA (JDK or JRE or both) in
Linux(ubuntu)
- In the instance ssh terminal, run -> uname -a
- It will show the OS version, for example, x86_64 is 64bit and ix86
- In your local machine or computer Download the specific version or tar.gz file that match with OS profile
- FTP into that instance, and move the *.tar.gz from your local machine to you home folder, for example /home/YOUR_USER_NAME
- In the instance terminal create directory by
- mkdir /opt/jdk
- Go to your home folder. For instance, cd /home/YOUR_USER_NAME
- You should see the tar.gz file over there. Untar the file by
- tar -zxf jdk-8u5-linux-x64.tar.gz -C /opt/jdk
- Verify that the file has been extracted into the /opt/jdk directory by
- ls /opt/jdk
- The java executable is located under /opt/jdk/jdk_SPECIFIC_VERSION/bin/java . To set it as the default JVM in your machine run:
- update-alternatives --install /usr/bin/java java /opt/jdk/jdk1.8.0_05/bin/java 100 and
- update-alternatives --install /usr/bin/javac javac /opt/jdk/jdk1.8.0_05/bin/javac 100
- Verify that java has been successfully configured by running:
- java -version
- and
- java -version
0 Comments