我曾多次不得不进入 apt 来删除JDK
> 8,因为至少目前,umake
安装Netbeans 8
只能在JDK
8 上运行。
我只需要JDK
8 Netbeans
,并且暂时需要 8,直到umake
安装NB
9。话虽如此,我怎样才能获得系统保持在JDK
8 (甚至可能JVM
8?) 与SDKMAN
?一致
或者,从根本上来说,这些是不同的系统——特定于用户帐户的 Java 版本控制SDKMAN
与系统配置?
thufir@dur:~$
thufir@dur:~$ javac -version
javac 11.0.1
thufir@dur:~$
thufir@dur:~$ sdk ls java
================================================================================
Available Java Versions
================================================================================
12.ea.20-open
11.0.1-zulu
11.0.1-open
10.0.2-zulu
10.0.2-open
9.0.7-zulu
9.0.4-open
* 8.0.192-zulu
8.0.191-oracle
7.0.201-zulu
6.0.119-zulu
1.0.0-rc-10-grl
1.0.0-rc-9-grl
1.0.0-rc-8-grl
================================================================================
+ - local version
* - installed
> - currently in use
================================================================================
thufir@dur:~$
不确定JDK
8 发生了什么:
thufir@dur:~$
thufir@dur:~$ java -version
openjdk version "11.0.1" 2018-10-16
OpenJDK Runtime Environment (build 11.0.1+13-Ubuntu-2ubuntu1)
OpenJDK 64-Bit Server VM (build 11.0.1+13-Ubuntu-2ubuntu1, mixed mode, sharing)
thufir@dur:~$
固定的为了现在:
thufir@dur:~$
thufir@dur:~$ sudo update-alternatives --config java
There are 2 choices for the alternative java (providing /usr/bin/java).
Selection Path Priority Status
------------------------------------------------------------
0 /usr/lib/jvm/java-11-openjdk-amd64/bin/java 1111 auto mode
1 /usr/lib/jvm/java-11-openjdk-amd64/bin/java 1111 manual mode
* 2 /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java 1081 manual mode
Press <enter> to keep the current choice[*], or type selection number: 2
thufir@dur:~$
thufir@dur:~$ sudo update-alternatives --config javac
There are 2 choices for the alternative javac (providing /usr/bin/javac).
Selection Path Priority Status
------------------------------------------------------------
0 /usr/lib/jvm/java-11-openjdk-amd64/bin/javac 1111 auto mode
1 /usr/lib/jvm/java-11-openjdk-amd64/bin/javac 1111 manual mode
* 2 /usr/lib/jvm/java-8-openjdk-amd64/bin/javac 1081 manual mode
Press <enter> to keep the current choice[*], or type selection number: 2
thufir@dur:~$
thufir@dur:~$ java -version
openjdk version "1.8.0_191"
OpenJDK Runtime Environment (build 1.8.0_191-8u191-b12-0ubuntu0.18.10.1-b12)
OpenJDK 64-Bit Server VM (build 25.191-b12, mixed mode)
thufir@dur:~$
thufir@dur:~$ javac -version
javac 1.8.0_191
thufir@dur:~$
但它变得越来越重复。