更新时间:2023-01-14 22:14:55
安装新版本的 JRE 时,此路径 C:\Program Files (x86)\Common Files\Oracle\Java
似乎使用与新 JRE 版本相对应的可执行文件进行了更新.问题是这将是 JRE 而不是 JDK.因此,依赖 JDK(例如 IDE)的程序将无法启动.
When a new version of JRE is installed, this path C:\Program Files (x86)\Common Files\Oracle\Java
appears to be updated with executables corresponding to the new JRE version. The problem is this would be JRE and not JDK. So, programs that depend on JDK (IDE for example) will fail to launch.
这是我如何让它始终如一地工作
JAVA_HOME
指向 JDK 主页.并将 %JAVA_HOME%\bin
添加到 PATH
环境变量中.Path
环境变量中删除了条目 C:\Program Files (x86)\Common Files\Oracle\Java\javapath
环境变量(控制面板 -> 系统 -> 高级系统设置 -> 环境变量 -> 系统变量).JAVA_HOME
pointing to the JDK Home. And add %JAVA_HOME%\bin
to the PATH
environment variable.C:\Program Files (x86)\Common Files\Oracle\Java\javapath
from the Path
environment variable in System Environment Variables (Control Panel -> System -> Advanced System Settings -> Environment Variables -> System Variables).自 2020 年 8 月起适用于 Windows 10 (1903)、Java 8u251.:)
This works as of Aug 2020 for Windows 10 (1903), Java 8u251. :)