http://dragonwell-jdk.io/?spm=a2c6h.13858378.0.0.63fa3931RHbFiR
wget https://dragonwell.oss-cn-shanghai.aliyuncs.com/8/8.6.5-GA/Alibaba_Dragonwell_8.6.5_GA_Linux_x64.tar.gz
tar -xvf Alibaba_Dragonwell_8.6.5_GA_Linux_x64.tar.gz
[root@iZbp1jf0fjkrh2jhr6j215Z data]# ./jdk8u282-b1/bin/java -version
openjdk version "1.8.0_282"
OpenJDK Runtime Environment (Alibaba Dragonwell 8.6.5) (build 1.8.0_282-b1)
OpenJDK 64-Bit Server VM (Alibaba Dragonwell 8.6.5) (build 25.282-b1, mixed mode)
[root@iZbp1jf0fjkrh2jhr6j215Z data]#
配置环境变量
cat >> ~/.bashrc << EOF
export JAVA_HOME=/data/jdk8u282-b1
export PATH=$PATH:$JAVA_HOME/bin
EOF
export JAVA_HOME=/data/jdk8u282-b1
export PATH=$PATH:$JAVA_HOME/bin
测试
cat > Hello.java <<EOF
public class Hello {
public static void main(String[] args) {
System.out.println("Hello World!");
}
}
EOF
[root@iZbp1jf0fjkrh2jhr6j215Z data]# javac Hello.java
[root@iZbp1jf0fjkrh2jhr6j215Z data]# java Hello
Hello World!
查看程序的字节码文件
[root@iZbp1jf0fjkrh2jhr6j215Z data]# javap -c Hello
Compiled from "Hello.java"
public class Hello {
public Hello();
Code:
0: aload_0
1: invokespecial #1 // Method java/lang/Object."<init>":()V
4: return
public static void main(java.lang.String[]);
Code:
0: getstatic #2 // Field java/lang/System.out:Ljava/io/PrintStream;
3: ldc #3 // String Hello World!
5: invokevirtual #4 // Method java/io/PrintStream.println:(Ljava/lang/String;)V
8: return
}