Kali安装JDK8和JDK17切换
在进行漏洞复现的时候,发现kali中JDK为17,所以一些POC用不了,需要JDK低版本
- 安装JDK1.8[下载地址]
mkdir -p /usr/local/java
cp jdk-8u251-linux-x64.tar.gz /usr/local/java
tar -zxvf jdk-8u251-linux-x64.tar.gz
- 配置环境变量
vim /etc/profile
# 进入环境变量
JAVA_HOME=/usr/local/java/jdk1.8.0_251
PATH=$PATH:$HOME/bin:$JAVA_HOME/bin
export JAVA_HOME
export PATH
# 通知Java目录
update-alternatives --install "/usr/bin/java" "java" "/usr/local/java/jdk1.8.0_251/bin/java" 1
update-alternatives --install "/usr/bin/javac" "javac" "/usr/local/java/jdk1.8.0_251/bin/javac" 1
update-alternatives --install "/usr/bin/javaws" "javaws" "/usr/local/java/jdk1.8.0_251/bin/javaws" 1
update-alternatives --install "/usr/bin/javaws" "javaws" "/usr/local/java/jdk1.8.0_251/bin/javaws" 1
- 切换Java版本
update-alternatives --config java
标签:bin,java,JDK17,Kali,alternatives,javaws,JDK8,usr,local
From: https://www.cnblogs.com/kalixcn/p/17862866.html