Last active
April 5, 2025 19:19
-
Star
(151)
You must be signed in to star a gist -
Fork
(37)
You must be signed in to fork a gist
-
-
Save filipelenfers/ef3f593deb0751944bb54b744bcac074 to your computer and use it in GitHub Desktop.
Install JDK from tar.gz Ubuntu
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Login as root | |
sudo su | |
#create jdk directory | |
mkdir /opt/jdk | |
#uncompress, change to your file name | |
tar -zxf jdk-8u5-linux-x64.tar.gz -C /opt/jdk | |
#check if files are there | |
#ls /opt/jdk | |
#update alternatives so the command java point to the new jdk | |
update-alternatives --install /usr/bin/java java /opt/jdk/jdk1.8.0_05/bin/java 100 | |
#update alternatives so the command javac point to the new jdk | |
update-alternatives --install /usr/bin/javac javac /opt/jdk/jdk1.8.0_05/bin/javac 100 | |
#check if java command is pointing to " link currently points to /opt/jdk/jdk1.8.0_05/bin/java" | |
update-alternatives --display java | |
#check if java command is pointing to " link currently points to /opt/jdk/jdk1.8.0_05/bin/javac" | |
update-alternatives --display javac | |
#check if java is running | |
java -version |
Thank You. Work for me
Thank you!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://www.openlogic.com/openjdk-downloads?field_java_parent_version_target_id=416&field_operating_system_target_id=426&field_architecture_target_id=391&field_java_package_target_id=396
tar.gz
file to/opt/
source ~/.bashrc
java -version