1。 下载 https://www.oracle.com/java/technologies/javase-jdk14-downloads.html
这里选择linux x64 tar.gz包,下载解压缩后即可使用。点击右边下载链接,会提示同意协议,和登录平台。
2。 上传到linux服务器,解压缩
tar -zxvf jdk-14.0.1_linux-x64_bin.tar.gz
移动到/usr/local/java 并重命名
mv jdk-14.0.1 /usr/local/java
3。 配置环境变量/etc/profile 放到末尾
export JAVA_HOME=/usr/local/java/
export PATH=$PATH:$JAVA_HOME/bin
4。 执行source /etc/profile 使生效
5. 验证
[root@VM_0_3_centos java]# javac
Usage: javac <options> <source files>
where possible options include:
@<filename> Read options and filenames from file
-Akey[=value] Options to pass to annotation processors
--add-modules <module>(,<module>)*
Root modules to resolve in addition to the initial modules, or all modules
on the module path if <module> is ALL-MODULE-PATH.
--boot-class-path <path>, -bootclasspath <path>
Override location of bootstrap class files
--class-path <path>, -classpath <path>, -cp <path>
Specify where to find user class files and annotation processors
-d <directory> Specify where to place generated class files
-deprecation
[root@VM_0_3_centos java]# java -version
java version "14.0.1" 2020-04-14
Java(TM) SE Runtime Environment (build 14.0.1+7)
Java HotSpot(TM) 64-Bit Server VM (build 14.0.1+7, mixed mode, sharing)
以上说明成功安装
[…] 3. 安装jdk(如果没有装) ,JDK需要11版本以上 CentOS安装jdk14 […]