How to install Jdk on linux

system version
System version: RedHat7.5
Jdk version: java version "17.0.1"
Download Jdk
Download link:
Other versions:
Server creation directory
mkdir -p /home/local/java
Copy files to the server
 scp /c/Users/cmdhelp/Desktop/jdk-17.0.1_linux-x64_bin.tar.gz root@
unzip files
 tar -zxvf jdk-8u271-linux-x64.tar.gz
Configure environment variables
vim /etc/profile
Add content at the end
export JAVA_HOME=/home/local/java/jdk-17.0.1
export PATH=$JAVA_HOME/bin:$PATH
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
File takes effect
source /etc/profile
Test whether Jdk is installed successfully

Was this helpful?

I hope to help every developer quickly find the commands they need. Of course, you can also add your own commonly used commands for easy searching.