java环境安装与配置win10(Windows中安装java11最不费力的方法)(1)

应用scoop工具安装最新版的,只需要打开window-terminal,然后运行:

scoop bucket add java

将java添加到scoop-bucket中,然后搜索可安装的java版本。

PS C:\Users\gaowei> scoop search openjdk 'java' bucket: adoptopenjdk-hotspot-jre (14.0.2-12) adoptopenjdk-hotspot (14.0.2-12) adoptopenjdk-lts-hotspot-jre (11.0.8-10) adoptopenjdk-lts-hotspot (11.0.8-10) adoptopenjdk-lts-openj9-jre (11.0.8-10-0.21.0) adoptopenjdk-lts-openj9-xl-jre (11.0.8-10-0.21.0) adoptopenjdk-lts-openj9-xl (11.0.8-10-0.21.0) adoptopenjdk-lts-openj9 (11.0.8-10-0.21.0) adoptopenjdk-lts-upstream-jre (11.0.8-10) adoptopenjdk-lts-upstream (11.0.8-10) adoptopenjdk-openj9-jre (14.0.2-12-0.21.0) adoptopenjdk-openj9-xl-jre (14.0.2-12-0.21.0) adoptopenjdk-openj9-xl (14.0.2-12-0.21.0) adoptopenjdk-openj9 (14.0.2-12-0.21.0) openjdk-ea (15-36) openjdk (14.0.2-12) openjdk10 (10.0.2-13) openjdk11 (11.0.2-9) openjdk12 (12.0.2-10) openjdk13 (13.0.2-8) openjdk14 (14.0.2-12) openjdk15 (15-36) openjdk7-unofficial (7u80-b32) openjdk9 (9.0.4-12)

开始安装:

scoop install openjdk11 Scoop was updated successfully! Installing 'openjdk11' (15-36) [64bit] openjdk-15_windows-x64_bin.zip (186.8 MB) [=====> ] 18%

安静地等待5分钟,核实安装的版本:

PS C:\Users\gaowei> java --version openjdk 11.0.2 2019-01-15 OpenJDK Runtime Environment 18.9 (build 11.0.2 9) OpenJDK 64-Bit Server VM 18.9 (build 11.0.2 9, mixed mode) PS C:\Users\gaowei> scoop which java C:\Users\gaowei\scoop\apps\openjdk11\current\bin\java.exe

卸载java只需要一行命令:

scoop uninstall java

以上就是用scoop包管理工具安装java的方法。

,