Ubuntu install JDK

西门马鲁
2023-12-01

1.open bashrc

vim ~/.bashrc

2.press i

3.insert

export JAVA_HOME=/home/wy/java/jdk-17.0.2
export JRE_HOME=/home/wy/java/jdk-17.0.2/jre
export CLASSPATH=.:$CLASSPATH:$JAVA_HOME/lib:$JRE_HOME/lib
export PATH=$PATH:$JAVA_HOME/bin:$JRE_HOME/bin

4.press Esc

5.input:wq! then out

6.To activate environment

source ~/.bashrc

7.register for system

sudo update-alternatives --install /usr/bin/java java /home/wy/java/jdk-17.0.2/bin/java 300

8.Test

java -version
 类似资料:

相关阅读

相关文章

相关问答