Installing Java JDK on Linux Systems

Description:

1. JDK is the software development kit for the Java language, and it is the core of Java development. It includes the Java Runtime Environment, Java core libraries, and Java tools. 2. Currently, there are five long-term support versions (LTS) of JDK: JDK8, JDK11, JDK17, JDK21, and JDK25. The JDK versions include Oracle JDK, OpenJDK, AdoptOpenJDK, Amazon Corretto, Alibaba Dragonwell, and Huawei Biheng JDK, among which Oracle JDK is the most widely used and has the most comprehensive versions. 4. OpenJDK is the open-source implementation of JDK SE created by Sun Microsystems, which is licensed under the GPL and can be used for free with open source code. 5. AdoptOpenJDK (Adoptium) is a pre-built OpenJDK binary distribution maintained by the Java community, while other versions are specific versions based on OpenJDK tailored to different use cases by various vendors. 6. Oracle JDK only releases binary installation packages, while OpenJDK only releases source code.

JDK Download Links:

1. Oracle JDK Download # You need to log in to download https://www.oracle.com/java/technologies/downloads/#java8 # Historical version download https://www.oracle.com/java/technologies/downloads/archive/
2. Open JDK Download https://openjdk.java.net http://hg.openjdk.java.net/ https://jdk.java.net/java-se-ri/8-MR4 https://wiki.openjdk.org/display/jdk8u/Main
3. Other Open Source JDK Downloads https://adoptium.net/zh-CN/temurin/releases   # Officially recommended OpenJDK compiled version http://www.codebaoku.com/jdk/jdk-index.html https://www.openlogic.com/openjdk-downloads
We use the officially recommended compiled version of OpenJDK: OpenJDK25U-jdk_x64_linux_hotspot_25_36.tar.gz Download link: https://adoptium.net/zh-CN/temurin/releases https://adoptium.net/zh-CN/download?link=https%3A%2F%2Fgithub.com%2Fadoptium%2Ftemurin25-binaries%2Freleases%2Fdownload%2Fjdk-25%252B36%2FOpenJDK25U-jdk_x64_linux_hotspot_25_36.tar.gz&vendor=Adoptium Upload OpenJDK25U-jdk_x64_linux_hotspot_25_36.tar.gz to the /usr/local/src directory

Installing JDK

# Create JDK installation path mkdir -p /data/server/java # Extract tar -zxvf /usr/local/src/OpenJDK25U-jdk_x64_linux_hotspot_25_36.tar.gz -C /data/server/java # Enter installation directory cd /data/server/java/jdk-25+36 # Check version information ./bin/java -version # Set environment variables vi /etc/profile  # Add the following information # Set Java 25 environment export JAVA_HOME=/data/server/java/jdk-21.0.4+7 export PATH=$JAVA_HOME/bin:$PATH:wq! # Save and exit # Make changes take effect immediately source /etc/profile # Check version information java -version [root@k8s-master01 java]# java -version openjdk version "25" 2025-09-16 LTS OpenJDK Runtime Environment Temurin-25+36 (build 25+36-LTS) OpenJDK 64-Bit Server VM Temurin-25+36 (build 25+36-LTS, mixed mode, sharing) [root@k8s-master01 java]# 
# Starting from JDK 21, there are no longer dt.jar and tools.jar files # List installed Java versions with yum rpm -qa | grep java # Uninstall rpm -e <package_name> # Find the current system's Java version ls -l $(which java) # Create soft links sudo ln -sf /data/server/java/jdk-25+36/bin/java /usr/bin/java sudo ln -sf /data/server/java/jdk-25+36/bin/java /usr/local/bin/java

Thus, the installation of Java JDK on Linux systems is complete.

Leave a Comment