![JDK8 安装程序在 Windows 10 上以 0xC0000005 退出](https://linux22.com/image/1559085/JDK8%20%E5%AE%89%E8%A3%85%E7%A8%8B%E5%BA%8F%E5%9C%A8%20Windows%2010%20%E4%B8%8A%E4%BB%A5%200xC0000005%20%E9%80%80%E5%87%BA.png)
当我尝试将 JDK 从 8u162 升级到 8u172 时发生了这种情况。我发现所有 8u162、8u171 和 8u172 安装程序都以代码退出0xC0000005
,但这只发生在 JDK 8 上。JDK 10.0.1 可以成功安装。
以下是 Visual Studio 对转储文件的分析:
Dump Summary
------------
Dump File: jdk-8u172-windows-x64.exe.10568.dmp : C:\Users\CNife\AppData\Local\CrashDumps\jdk-8u172-windows-x64.exe.10568.dmp
Last Write Time: 2018/4/21 21:54:54
Process Name: jdk-8u172-windows-x64.exe : C:\Users\CNife\AppData\Local\Temp\jds301015.tmp\jdk-8u172-windows-x64.exe
Process Architecture: x64
Exception Code: 0xC0000005
Exception Information: The thread tried to read from or write to a virtual address for which it does not have the appropriate access.
Heap Information: Not Present
System Information
------------------
OS Version: 10.0.16299
CLR Version(s):
Modules
-------
Module Name Module Path Module Version
----------- ----------- --------------
jdk-8u172-windows-x64.exe C:\Users\CNife\AppData\Local\Temp\jds301015.tmp\jdk-8u172-windows-x64.exe 8.0.1720.11
ntdll.dll C:\Windows\System32\ntdll.dll 10.0.16299.334
kernel32.dll C:\Windows\System32\kernel32.dll 10.0.16299.15
KERNELBASE.dll C:\Windows\System32\KERNELBASE.dll 10.0.16299.371
apphelp.dll C:\Windows\System32\apphelp.dll 10.0.16299.98
ole32.dll C:\Windows\System32\ole32.dll 10.0.16299.371
combase.dll C:\Windows\System32\combase.dll 10.0.16299.15
ucrtbase.dll C:\Windows\System32\ucrtbase.dll 10.0.16299.248
rpcrt4.dll C:\Windows\System32\rpcrt4.dll 10.0.16299.371
bcryptPrimitives.dll C:\Windows\System32\bcryptPrimitives.dll 10.0.16299.98
gdi32.dll C:\Windows\System32\gdi32.dll 10.0.16299.15
gdi32full.dll C:\Windows\System32\gdi32full.dll 10.0.16299.98
msvcp_win.dll C:\Windows\System32\msvcp_win.dll 10.0.16299.248
user32.dll C:\Windows\System32\user32.dll 10.0.16299.125
win32u.dll C:\Windows\System32\win32u.dll 10.0.16299.15
sechost.dll C:\Windows\System32\sechost.dll 10.0.16299.15
shell32.dll C:\Windows\System32\shell32.dll 10.0.16299.371
msvcrt.dll C:\Windows\System32\msvcrt.dll 7.0.16299.125
cfgmgr32.dll C:\Windows\System32\cfgmgr32.dll 10.0.16299.15
SHCore.dll C:\Windows\System32\SHCore.dll 10.0.16299.15
windows.storage.dll C:\Windows\System32\windows.storage.dll 10.0.16299.371
advapi32.dll C:\Windows\System32\advapi32.dll 10.0.16299.371
shlwapi.dll C:\Windows\System32\shlwapi.dll 10.0.16299.15
kernel.appcore.dll C:\Windows\System32\kernel.appcore.dll 10.0.16299.15
powrprof.dll C:\Windows\System32\powrprof.dll 10.0.16299.15
profapi.dll C:\Windows\System32\profapi.dll 10.0.16299.15
oleaut32.dll C:\Windows\System32\oleaut32.dll 10.0.16299.15
crypt32.dll C:\Windows\System32\crypt32.dll 10.0.16299.15
msasn1.dll C:\Windows\System32\msasn1.dll 10.0.16299.15
version.dll C:\Windows\System32\version.dll 10.0.16299.15
msi.dll C:\Windows\System32\msi.dll 5.0.16299.309
bcrypt.dll C:\Windows\System32\bcrypt.dll 10.0.16299.125
imm32.dll C:\Windows\System32\imm32.dll 10.0.16299.15
我很高兴地宣布这个问题已经解决了!请往下看我的回答以了解具体步骤。谢谢你的帮助!
答案1
我很高兴发现为什么我无法在 Windows 10 上安装 JDK8。
真正的原因是我的 Windows 上有一个损坏的 JDK8 安装。升级到 8u162 时,JDK 的安装程序没有完全删除版本 8u152 的安装。因此,当我尝试将 8u162 升级到 8u172 时,错误的注册表值总是会导致失败。
当我尝试通过 Visual Studio 安装程序安装 JDK 时,我发现了真正的原因。不出所料,它失败了,代码相同为 0xC0000005。与 JDK 安装程序不同,Visual Studio 安装程序留下了详细的安装日志。在日志的末尾,我发现了以下几行:
[2018/04/25 23:19:10.371, jdk-8u161-windows-i586.exe (PID: 12756, TID: 12572), JavaEnvironment.cpp:473 (JavaEnvironment::detect)]
TRACE: Entering JavaEnvironment::detect
[2018/04/25 23:19:10.386, jdk-8u161-windows-i586.exe (PID: 12756, TID: 12572), JavaEnvironment.cpp:490 (JavaEnvironment::detect)]
TRACE: Installed Java detected: version=1.8.0; arch=64; productCode={64A3A4F4-B792-11D6-A78A-00B0D0180152}; type=1
[2018/04/25 23:19:10.386, jdk-8u161-windows-i586.exe (PID: 12756, TID: 12572), JavaEnvironment.cpp:140 (`anonymous-namespace'::detectHomeDir)]
TRACE: Find home dir of {64A3A4F4-B792-11D6-A78A-00B0D0180152} Java installation
[2018/04/25 23:19:10.402, jdk-8u161-windows-i586.exe (PID: 12756, TID: 12572), JavaEnvironment.cpp:154 (`anonymous-namespace'::detectHomeDir)]
WARNING: Unexpected empty value of [InstallLocation] product property of {64A3A4F4-B792-11D6-A78A-00B0D0180152} Java installation. Fall back to heuristic home directory detection.
[2018/04/25 23:19:10.402, jdk-8u161-windows-i586.exe (PID: 12756, TID: 12572), JavaEnvironment.cpp:162 (`anonymous-namespace'::detectHomeDir)]
TRACE: Try home directory from [ProductIcon] product property of {64A3A4F4-B792-11D6-A78A-00B0D0180152} Java installation.
[2018/04/25 23:19:10.419, jdk-8u161-windows-i586.exe (PID: 12756, TID: 12572), JavaEnvironment.cpp:191 (`anonymous-namespace'::detectHomeDir)]
TRACE: Try home directory from [Readme] registry value of {64A3A4F4-B792-11D6-A78A-00B0D0180152} Java installation.
[2018/04/25 23:19:10.455, jdk-8u161-windows-i586.exe (PID: 7320, TID: 13960), FileUtils.cpp:603 (FileUtils::`anonymous-namespace'::deleteFileImpl)]
TRACE: Deleted [C:\Users\CNife\AppData\Local\Temp\jds1029609.tmp\jdk-8u161-windows-i586.exe] file
[2018/04/25 23:19:10.459, jdk-8u161-windows-i586.exe (PID: 7320, TID: 13960), FileUtils.cpp:654 (FileUtils::deleteDirectory)]
TRACE: Deleted [C:\Users\CNife\AppData\Local\Temp\jds1029609.tmp] directory
它显示我已经有一个JDK8安装,但我找不到!
所以一切都很简单,我下载了微软的一个官方工具:修复阻止程序安装或删除的问题
在卸载软件列表中,找到“Java 8 Update 152 (64-bit)”。点击“下一步”即可将其完全删除。然后我双击 8u172 的安装程序,成功了!