Download the JDK for Linux 32-bit or 64-bit
https://mirrors.huaweicloud.com/java/jdk/
Example:
Make a directory in /usr/local where java will reside and copy tarball there:
sudo mkdir -p /usr/local/java
Navigate to /usr/local/java:
cd /usr/local/java
Download with wget
https://mirrors.huaweicloud.com/java/jdk/7u80-b15/jdk-7u80-linux-x64.tar.gz
Extract the tarball:
sudo tar xvzf jdk-7u80-linux-x64.tar.gz
Check if tarball has been successfully extracted:
ls –a
Find and select Java's path
update-alternatives --config java
Edit /etc/profile with sudo privileges:
sudo vi /etc/profile
Add the following lines below to the end of /etc/profile file:
JAVA_HOME=/usr/local/java/jdk1.7.0_80
JRE_HOME=/usr/local/java/jdk1.7.0_80
PATH=$PATH:$JRE_HOME/bin:$JAVA_HOME/bin
export JAVA_HOME
export JRE_HOME
export PATH
Update alternatives:
sudo update-alternatives --install "/usr/bin/java" "java" "/usr/local/java/jdk1.7.0_80/bin/java" 1
sudo update-alternatives --install "/usr/bin/javac" "javac" "/usr/local/java/jdk1.7.0_80/bin/javac" 1
sudo update-alternatives --install "/usr/bin/javaws" "javaws" "/usr/local/java/jdk1.7.0_80/bin/javaws" 1
sudo update-alternatives --set java /usr/local/java/jdk1.7.0_80/bin/java
sudo update-alternatives --set javac /usr/local/java/jdk1.7.0_80/bin/javac
sudo update-alternatives --set javaws /usr/local/java/jdk1.7.0_80/bin/javaws
Reload profile:
source /etc/profile
Verify installation:
java -version
You should receive a message which displays:
java version "1.7.0_80"
Java(TM) SE Runtime Environment (build 1.7.0_80-b15)
Java HotSpot(TM) 64-Bit Server VM (build 24.80-b11, mixed mode)
https://www.digitalocean.com/community/tutorials/how-to-install-java-on-centos-and-fedora
https://www.liquidweb.com/kb/install-java-8-on-centos-7/
https://mirrors.huaweicloud.com/java/jdk/
Example:
Make a directory in /usr/local where java will reside and copy tarball there:
sudo mkdir -p /usr/local/java
Navigate to /usr/local/java:
cd /usr/local/java
Download with wget
https://mirrors.huaweicloud.com/java/jdk/7u80-b15/jdk-7u80-linux-x64.tar.gz
Extract the tarball:
sudo tar xvzf jdk-7u80-linux-x64.tar.gz
Check if tarball has been successfully extracted:
ls –a
Find and select Java's path
update-alternatives --config java
Edit /etc/profile with sudo privileges:
sudo vi /etc/profile
Add the following lines below to the end of /etc/profile file:
JAVA_HOME=/usr/local/java/jdk1.7.0_80
JRE_HOME=/usr/local/java/jdk1.7.0_80
PATH=$PATH:$JRE_HOME/bin:$JAVA_HOME/bin
export JAVA_HOME
export JRE_HOME
export PATH
Update alternatives:
sudo update-alternatives --install "/usr/bin/java" "java" "/usr/local/java/jdk1.7.0_80/bin/java" 1
sudo update-alternatives --install "/usr/bin/javac" "javac" "/usr/local/java/jdk1.7.0_80/bin/javac" 1
sudo update-alternatives --install "/usr/bin/javaws" "javaws" "/usr/local/java/jdk1.7.0_80/bin/javaws" 1
sudo update-alternatives --set java /usr/local/java/jdk1.7.0_80/bin/java
sudo update-alternatives --set javac /usr/local/java/jdk1.7.0_80/bin/javac
sudo update-alternatives --set javaws /usr/local/java/jdk1.7.0_80/bin/javaws
Reload profile:
source /etc/profile
Verify installation:
java -version
You should receive a message which displays:
java version "1.7.0_80"
Java(TM) SE Runtime Environment (build 1.7.0_80-b15)
Java HotSpot(TM) 64-Bit Server VM (build 24.80-b11, mixed mode)
https://www.digitalocean.com/community/tutorials/how-to-install-java-on-centos-and-fedora
https://www.liquidweb.com/kb/install-java-8-on-centos-7/
Comments
Post a Comment