Jdk 17 Install & Configure
Install Jdk on Rokcy Linux
Linux Install
refer to : https://docs.redhat.com/en/documentation/red_hat_build_of_openjdk/17/html-single/installing_and_using_red_hat_build_of_openjdk_17_on_rhel/index#installing-jdk-on-rhel-using-archive_openjdk
1.Create a directory to where you want to download the archive file, and then navigate to that directory on your command-line interface (CLI).
cd /opt
mkdir OpenJdk
pwd
/opt/OpenJdk
2.download the JDK archive for Linux to your local system.
https://access.redhat.com/jbossnetwork/restricted/listSoftware.html?downloadType=distributions&product=core.service.openjdk&version=11.0.15
3.Extract the contents of the archive to a directory of your choice:
tar -xf java-17-openjdk-17.0.12.0.7-1.portable.jdk.el.x86_64.tar.xz
mv java-17-openjdk-17.0.12.0.7-1.portable.jdk.el.x86_64 Jdk17
4.editor /etc/profile,Configure the JAVA_HOME environment variable:
vim /etc/profile
## 按大G健,切换最后一行,添加以下内容
export JAVA_HOME=/opt/OpenJdk/Jdk17
export PATH="$JAVA_HOME/bin:$PATH"
上面的第二行内容的目的是:
Add the bin directory of the generic JRE path to the PATH environment variable
5.生效
# 使配置文件生效
source /etc/profile
# verify
printenv | grep JAVA_HOME
java -version
6.如果装了多个版本的jdk,想指定使用某个版本jdk时,指定java路径就行了
[root@mqxctest Jdk17]# /opt/OpenJdk/Jdk17/bin/java --version
openjdk 17.0.12 2024-07-16 LTS
OpenJDK Runtime Environment (Red_Hat-17.0.12.0.7-1) (build 17.0.12+7-LTS)
OpenJDK 64-Bit Server VM (Red_Hat-17.0.12.0.7-1) (build 17.0.12+7-LTS, mixed mode, sharing)
Install Jdk On Debian 11
OpenJdk的发行版,选择了Eclipse Temurin
archives的下载地址:https://github.com/adoptium/temurin17-binaries/releases?page=2
具体版本是:OpenJDK17U-jdk_x64_linux_hotspot_17.0.12_7.tar.gz
下载地址:
https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.12%2B7/OpenJDK17U-jdk_x64_linux_hotspot_17.0.12_7.tar.gz
1.下载OpenJDK17的linux binary文件,并解压
cd /opt
mkdir OpenJdk
pwd
/opt/OpenJdk
tar -zxf OpenJDK17U-jdk_x64_linux_hotspot_17.0.12_7.tar.gz
mv jdk-17.0.12+7 Jdk17
2.editor /etc/profile,Configure the JAVA_HOME environment variable:
vim /etc/profile
## 按大G健,切换最后一行,添加以下内容
export JAVA_HOME=/opt/OpenJdk/Jdk17
export PATH="$JAVA_HOME/bin:$PATH"
上面的第二行内容的目的是:
Add the bin directory of the generic JRE path to the PATH environment variable
3.生效
# 使配置文件生效
source /etc/profile
# verify
printenv | grep JAVA_HOME
java -version
文章作者:Administrator
文章链接:http://localhost:8090//archives/jdk-17-install-configure
版权声明:本博客所有文章除特别声明外,均采用CC BY-NC-SA 4.0 许可协议,转载请注明出处!
评论