ThinkChat2.0新版上线,更智能更精彩,支持会话、画图、阅读、搜索等,送10W Token,即刻开启你的AI之旅 广告
[TOC] # Linux安装jdk ## yum安装 查询yum库中有哪些`jdk`版本: ``` $ yum search java|grep jdk ``` 我选择最新版本 ``` $ yum install -y java-11-openjdk //查看版本 $ java --version //需要再安装 java-11-openjdk-devel.x86_64 否则找不到 javac $ yum install -y java-11-openjdk-devel.x86_64 ``` ## 用`Dockerfile`安装 ``` From centos:7 RUN yum install java-11-openjdk -y \ java-11-openjdk-devel.x86_64 \ net-tools RUN export JAVA_HOME=/usr/lib/jvm/java-11-openjdk-11.0.4.11-0.el7_6.x86_64/:$PATH \ && export PATH=$JAVA_HOME/bin:$PATH ``` 在/etc/profile文件末尾添加: ``` export JAVA\_HOME=/home/znn/development/jdk1.8.0\_111 export JRE\_HOME=/home/znn/development/jdk1.8.0\_111/jre export CLASSPATH=.:$JAVA\_HOME/lib:$JRE\_HOME/lib export PATH=$JAVA\_HOME/bin:$PATH ``` 使配置文件立即生效: ``` $ source /etc/profile ``` # windows10下安装 参考链接:[https://www.runoob.com/w3cnote/windows10-java-setup.html](https://www.runoob.com/w3cnote/windows10-java-setup.html) # Mac下安装 参考链接:[https://juejin.im/post/5d1b17eef265da1b672127d0](https://juejin.im/post/5d1b17eef265da1b672127d0)