231018_EndeavourOS上安装OpenJDK
两年前在manjaro上配过Java环境,当时是下载的OracleJDK 8。现在尝试在新机上安装OpenJDK 21。
参考https://wiki.archlinux.org/title/Java
在arch官网的Packages搜索jdk,得知我们要的包名是jdk-openjdk
1 | sudo pacman -S jdk-openjdk |
jre-openjdk
もちろん也被包含了
验证
1 | java -version |
java-runtime-common
也在下载jdk时被一同包括了,里面有一个arch系的helper script,可以archlinux-java <COMMAND>
1 | archlinux-java status 列出可用的java环境 |
再尝试安装个jdk8。All these JVM can be installed without conflict and switched between using helper script archlinux-java
1 | sudo pacman -S jdk8-openjdk |
然后就可以切换了
1 | sudo archlinux-java set java-8-openjdk |
查看,确实变java8了
1 | java -version |
- Title: 231018_EndeavourOS上安装OpenJDK
- Author: Haoliang Tang
- Created at : 2023-10-18 00:00:00
- Updated at : 2023-11-02 20:30:32
- Link: https://hl-tang.github.io/2023/10/18/231018_EndeavourOS上安装OpenJDK/
- License: This work is licensed under CC BY-NC-SA 4.0.
Comments