无法安装 JDK 9,因为“正在进行另一个 Java 安装”

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/44641878/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-11-03 08:16:54  来源:igfitidea点击:

Can't install JDK 9 because "Another Java installation is in progress"

java

提问by Clancy Merrick

I have been using JDK 9 on Windows 10 x64 for a while but when I went to install the latest early release (b174), I first uninstalled the previous version (as usual) and then ran the new installer.

我已经在 Windows 10 x64 上使用 JDK 9 有一段时间了,但是当我去安装最新的早期版本 (b174) 时,我首先卸载了以前的版本(像往常一样),然后运行了新的安装程序。

It fails with a message box saying "Another Java installation is in progress. You must complete that installation before you can run this installer".

它失败并显示消息框“正在进行另一个 Java 安装。您必须先完成该安装,然后才能运行此安装程序”。

It seems there are some artifacts around causing the problem but only for JDK 9 as I can uninstall & reinstall JDK 8 without any issues. Also, the same problem occurs if I try to run the installers for any prior JDK 9 releases as well (even though they worked before).

似乎存在一些导致问题的工件,但仅适用于 JDK 9,因为我可以卸载并重新安装 JDK 8 而没有任何问题。此外,如果我尝试为任何以前的 JDK 9 版本运行安装程序,也会出现同样的问题(即使它们以前工作过)。

Searches have suggested various options like using a Microsoft MSI clean-up tool and registry hacks but nothing is helping.

搜索建议了各种选项,例如使用 Microsoft MSI 清理工具和注册表黑客,但没有任何帮助。

Can anyone suggest a way to get JDK 9 installed (as now I cannot use any release of JDK 9 at all)?

谁能建议一种安装 JDK 9 的方法(因为现在我根本无法使用任何版本的 JDK 9)?

回答by BlackSheeep

On Windows, Java prevents starting the Installer twice by creating (two) lock files. If those files exist, Java Installer show the Message: "Another Java installation is in progress (...)".

在 Windows 上,Java 通过创建(两个)锁定文件来防止启动安装程序两次。如果这些文件存在,Java 安装程序会显示消息:“正在进行另一个 Java 安装 (...)”。

If Java Installer crashes, or Windows crashes during Java Installation, the installer cannot delete the lock files when finalizing.

如果 Java 安装程序崩溃,或在 Java 安装过程中 Windows 崩溃,则安装程序在完成时无法删除锁定文件。

Solution:

解决方案:

Deleting the lock files, unlocks the Installer and Java can be installed again.

删除锁定文件,解锁安装程序,可以再次安装 Java。

The lock files are located at:

锁定文件位于:

C:\ProgramData\Oracle\Java\JAVA_INSTALL_FLAG
%USERPROFILE%\AppData\LocalLow\Sun\Java\JAVA_INSTALL_FLAG
%USERPROFILE%\AppData\LocalLow\Oracle\Java\JAVA_INSTALL_FLAG

回答by AhmedBM

Although this was written for JDK9, JDK10will suffer from the same issue BUT the lock location is different. The new lock file is located in %USERPROFILE%\AppData\LocalLow\Sun\Java\JAVA_INSTALL_FLAG.

虽然这是为JDK9编写的,但JDK10会遇到同样的问题,但锁位置不同。新的锁定文件位于 %USERPROFILE%\AppData\LocalLow\Sun\Java\JAVA_INSTALL_FLAG.

Simply deleting this file should allow you to proceed with the install.

只需删除此文件即可继续安装。

回答by Thope

I had this problem also and i came to this page but i couldn't solve it at first because i thought my system didn't have 'ProgramData' in my C: drive because its hidden i guess. This is what worked for me. Go to the windows file explorer and delete the 'JAVA_INSTALL_FLAG' files in all these directories

我也遇到了这个问题,我来到了这个页面,但一开始我无法解决它,因为我认为我的系统在我的 C: 驱动器中没有“ProgramData”,因为我猜它是隐藏的。这对我有用。转到 Windows 文件资源管理器并删除所有这些目录中的“JAVA_INSTALL_FLAG”文件

%ProgramData%\Oracle\Java
%UserProile%\AppData\LocalLow\Sun\Java
%UserProile%\AppData\LocalLow\Oracle\Java

Then Java jdk installs smoothly. i have recreated this problem and tried this solution again and it works.

然后Java jdk安装顺利。我重新创建了这个问题并再次尝试了这个解决方案并且它有效。

回答by NurSultan

This helped me:

这帮助了我:

DELETE:

删除:

%USERPROFILE%\AppData\LocalLow\Oracle\Java\JAVA_INSTALL_FLAG
and
%USERPROFILE%\AppData\LocalLow\Sun\Java\JAVA_INSTALL_FLAG

回答by Lex van Buiten

Kill any remaining Windows? installer msiexec.exeprocesses using the Task Manager of Windows. The Windows installer process apparently locks any java files/processes which blocks the Java JDK to be updated.

杀死任何剩余的 Windows?安装msiexec.exe程序使用 Windows 的任务管理器进行处理。Windows 安装程序进程显然会锁定任何阻止 Java JDK 更新的 Java 文件/进程。

My problem installing Java 9 began after I upgraded JetBeans IntelliJ which uses Java JRE/JDK. I first tried the suggested solution that BlackSheeep posted, but without any luck.

在升级使用 Java JRE/JDK 的 JetBeans IntelliJ 后,我开始安装 Java 9 的问题。我首先尝试了BlackSheeep 发布的建议解决方案,但没有任何运气。

回答by MonoThreaded

I don't mean to be cheap but Control Panel> Uninstall a program> Java 9is your friend

我的意思并不是要便宜,但Control Panel> Uninstall a program>Java 9是你的朋友

回答by Kaumadie Kariyawasam

on windows 10, delete below directories,

在 Windows 10 上,删除以下目录,

C:\Program Files\Java C:\ProgramData\Oracle\Java C:\Users\%UserName%\AppData\LocalLow\Sun\Java C:\Users\%UserName%\AppData\LocalLow\Oracle\Java

C:\Program Files\Java C:\ProgramData\Oracle\Java C:\Users\%UserName%\AppData\LocalLow\Sun\Java C:\Users\%UserName%\AppData\LocalLow\Oracle\Java

and try again.

然后再试一次。

回答by martin_

Try locating the lock file here:

尝试在此处找到锁定文件:

%USERPROFILE%\AppData\LocalLow\Oracle\Java

Deleting it allowed my Java 10 installation to start.

删除它允许我的 Java 10 安装开始。