在 Windows XP 上安装 JDK8 - advapi32.dll 错误 [英] installing JDK8 on Windows XP - advapi32.dll error

查看:25
本文介绍了在 Windows XP 上安装 JDK8 - advapi32.dll 错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我下载了 JDK8 build b121 并且在尝试安装时出现以下错误:

I downloaded JDK8 build b121 and while trying to install I'm getting the following error:

在动态链接库ADVAPI32.dll中找不到过程入口点RegDeleteKeyExA

操作系统为 Windows XP,版本 2002 Service Pack 3,32 位.

The operating system is Windows XP, Version 2002 Service Pack 3, 32-bit.

推荐答案

发生这种情况是因为 Oracle 放弃了对 Windows XP 的支持(安装程序在其 ADVAPI32 中没有使用 RegDeleteKeyExA.DLL 顺便说一下)如 http://mail.openjdk.java.net/pipermail/openjfx-dev/2013-July/009005.html.然而,虽然对 XP 的官方支持已经结束,但 Java 二进制文件仍然(至少从 Java 8u20 EA b05 开始)与 XP 兼容——只是安装程序不是......

This happens because Oracle dropped support for Windows XP (which doesn't have RegDeleteKeyExA used by the installer in its ADVAPI32.DLL by the way) as described in http://mail.openjdk.java.net/pipermail/openjfx-dev/2013-July/009005.html. Yet while the official support for XP has ended, the Java binaries are still (as of Java 8u20 EA b05 at least) XP-compatible - only the installer isn't...

因此,解决方案实际上很简单:

Because of that, the solution is actually quite easy:

  1. 获取 7-Zip(或任何其他好的解包器),手动解压发行版 .exe,其中包含一个 .zip 文件(tools.zip),也将其解压缩,

使用 JDK8 中的 unpack200 将所有 .pack 文件解压为 .jar 文件(旧的解包将无法正常工作);JAVA_HOME 环境变量应设置为您的 Java 解包根目录,例如"C:Program FilesJavajdk8" - 您可以通过例如

use unpack200 from JDK8 to unpack all .pack files to .jar files (older unpacks won't work properly); JAVA_HOME environment variable should be set to your Java unpack root, e.g. "C:Program FilesJavajdk8" - you can specify it implicitly by e.g.

SET JAVA_HOME=C:Program FilesJavajdk8

  • 使用单个命令解压所有文件(在批处理文件中):

    • Unpack all files with a single command (in batch file):

      FOR /R %%f IN (*.pack) DO "%JAVA_HOME%inunpack200.exe" -r -v "%%f" "%%~pf%%~nf.jar"
      

    • 使用单个命令(来自 JRE 根目录的命令行)解压所有文件:

    • Unpack all files with a single command (command line from JRE root):

      FOR /R %f IN (*.pack) DO "binunpack200.exe" -r -v "%f" "%~pf%~nf.jar"
      

    • 通过手动定位文件并一一解压来解压:

    • Unpack by manually locating the files and unpacking them one-by-one:

      %JAVA_HOME%inunpack200 -r packname.pack packname.jar
      

    • 其中 packname 是例如 rt

      将您要使用的工具(例如 Netbeans)指向 %JAVA_HOME% 即可.

      point the tool you want to use (e.g. Netbeans) to the %JAVA_HOME% and you're good to go.

      注意:您可能不应该仅仅为了在您的 Web 浏览器中使用 Java 8 或出于任何类似原因(想到安装 JRE 8)而这样做;主要 Java 版本发布的早期更新中的安全漏洞是(请注意我)传奇,而且在 XP 上对 XP 和 Java 8 都没有真正支持只会使情况变得更糟.更不用说您通常不需要在您的浏览器中使用 Java(参见例如 http://nakedsecurity.sophos.com/2013/01/15/disable-java-browsers-homeland-security/ - 该主题已经在许多页面,如果您需要更多信息,只需谷歌一下).在任何情况下,AFAIK 将此过程应用于 JRE 的唯一要求是将上面指定的一些路径从 in 更改为 lib(文件位置安装程序目录树中的内容略有不同) - 但我强烈建议不要这样做.

      Note: you probably shouldn't do this just to use Java 8 in your web browser or for any similar reason (installing JRE 8 comes to mind); security flaws in early updates of major Java version releases are (mind me) legendary, and adding to that no real support for neither XP nor Java 8 on XP only makes matters much worse. Not to mention you usually don't need Java in your browser (see e.g. http://nakedsecurity.sophos.com/2013/01/15/disable-java-browsers-homeland-security/ - the topic is already covered on many pages, just Google it if you require further info). In any case, AFAIK the only thing required to apply this procedure to JRE is to change some of the paths specified above from in to lib (the file placement in installer directory tree is a bit different) - yet I strongly advise against doing it.

      另见:如何将最新的 JRE/JDK 作为 zip 文件而不是 EXE 或 MSI 安装程序获取?, JRE 1.7 - java 版本 - 返回:java/lang/NoClassDefFoundError:java/lang/Object

      这篇关于在 Windows XP 上安装 JDK8 - advapi32.dll 错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆