分享 | 交流
让学习成为一种习惯

Linux下源码安装JDK-10.0.1

1、下载JDK

http://www.oracle.com/technetwork/java/javase/downloads/jdk10-downloads-4416644.html

Product / File Description File Size Download
Linux 305.97 MB jdk-10.0.1_linux-x64_bin.rpm
Linux 338.41 MB jdk-10.0.1_linux-x64_bin.tar.gz
macOS 395.46 MB jdk-10.0.1_osx-x64_bin.dmg
Solaris SPARC 206.63 MB jdk-10.0.1_solaris-sparcv9_bin.tar.gz
Windows 390.19 MB jdk-10.0.1_windows-x64_bin.exe

wget http://download.oracle.com/otn-pub/java/jdk/10.0.1+10/fb4372174a714e6b8c52526dc134031e/jdk-10.0.1_linux-x64_bin.tar.gz

2、解压JDK

tar zxf jdk-10.0.1_linux-x64_bin.tar.gz

出现文件夹jdk-10.0.1并且转移到/opt目录下 mv jdk-10.0.1 /opt/

3、编辑配置文件,添加环境变量

tee /etc/profile <<EOF
#set java environment
export JAVA_HOME=/opt/jdk-10.0.1
export JRE_HOME=${JAVA_HOME}/jre
export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib
export PATH=${JAVA_HOME}/bin:$PATH
EOF

source /etc/profile

5、验证安装结果

java -version
java version “10.0.1” 2018-04-17
Java(TM) SE Runtime Environment 18.3 (build 10.0.1+10)
Java HotSpot(TM) 64-Bit Server VM 18.3 (build 10.0.1+10, mixed mode)

到此为止,整个安装过程结束。

未经允许不得转载:留时刻运维网 » Linux下源码安装JDK-10.0.1

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

留时刻 - Linux系统教程,运维经验分享

加入我们给我留言