在Windows XP上安装JDK8 - advapi32.dll错误 [英] installing JDK8 on Windows XP - advapi32.dll error
问题描述
我下载了 JDK8 build b121,而在尝试安装时,我收到以下错误:
过程入口点RegDeleteKeyExA无法位于动态链接库ADVAPI32.dll中
操作系统是Windows XP,版本2002 Service Pack 3,32位。
发生是因为Oracle放弃了对Windows XP的支持(安装程序在 ADVAPI32.DLL
中没有使用 RegDeleteKeyExA
顺便说一下),如 http://邮件中所述.openjdk.java.net / pipermail /的OpenJFX-dev /目录2013-7 / 009005.html 。尽管官方对XP的支持已经结束,但Java二进制文件仍然是(至少Java 8u20 EA b05)与XP兼容 - 只有安装程序不是...
因为这样,解决方案实际上很简单:
-
获得7-zip(或任何其他质量档案) ,手动解压缩.exe文件,它里面有一个.zip文件(
tools.zip
),也解压, -
使用JDK8中的
unpack200
将所有.pack文件解压缩到.jar文件(旧的解包不能正常工作);JAVA_HOME
环境变量应设置为您的Java解包根,例如C:\Program Files\Java\jdk8 - 您可以通过例如SET JAVA_HOME = C :\Program Files\Java\jdk8
-
使用单个命令打包所有文件(批处理文件):
FOR / R %% f IN(* .pack)DO %JAVA_HOME%\bin\unpack200.exe-r -v%% f%%〜pf %%〜nf.jar
-
使用单个命令打包所有文件(来自JRE root的命令行):
code> FOR / R%f IN(* .pack)DObin\unpack200.exe-r -v%f%〜pf%〜nf.jar
-
通过手动查找文件并逐个解包,解开包装:
%JAVA_HOME%\bin\unpack200 -r packname.pack packname.jar
/ li>
其中
packname
是例如rt
-
-
将您要使用的工具(例如Netbeans)指向
%JAVA_H OME%
,你很好去。
注意:这样做只是为了在您的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所需的唯一方法是将上述指定的路径从\bin\更改为\lib\(安装程序目录树中的文件位置有所不同)但是我强烈反对这样做。
另请参见:如何将最新的JRE / JDK作为zip文件而不是EXE或MSI安装程序?, JRE 1.7返回:java / lang / NoClassDefFoundError:java / lang / Object
I downloaded JDK8 build b121 and while trying to install I'm getting the following error:
the procedure entry point RegDeleteKeyExA could not be located in the dynamic link library ADVAPI32.dll
The operating system is Windows XP, Version 2002 Service Pack 3, 32-bit.
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:
get 7-zip (or any other quality archiver), unpack the distribution .exe manually, it has one .zip file inside of it (
tools.zip
), extract it too,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 Files\Java\jdk8" - you can specify it implicitly by e.g.SET JAVA_HOME=C:\Program Files\Java\jdk8
Unpack all files with a single command (in batch file):
FOR /R %%f IN (*.pack) DO "%JAVA_HOME%\bin\unpack200.exe" -r -v "%%f" "%%~pf%%~nf.jar"
Unpack all files with a single command (command line from JRE root):
FOR /R %f IN (*.pack) DO "bin\unpack200.exe" -r -v "%f" "%~pf%~nf.jar"
Unpack by manually locating the files and unpacking them one-by-one:
%JAVA_HOME%\bin\unpack200 -r packname.pack packname.jar
where
packname
is for examplert
point the tool you want to use (e.g. Netbeans) to the
%JAVA_HOME%
and you're good to go.
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 \bin\ to \lib\ (the file placement in installer directory tree is a bit different) - yet I strongly advise against doing it.
See also: How can I get the latest JRE / JDK as a zip file rather than EXE or MSI installer?, JRE 1.7 returns: java/lang/NoClassDefFoundError: java/lang/Object
这篇关于在Windows XP上安装JDK8 - advapi32.dll错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!