Installing JDK8 on Windows XP - advapi32.dll error

I downloaded the JDK8 build b121 and trying to install, I get the following error:

RegDeleteKeyExA procedure entry point cannot be located in the dynamic link library ADVAPI32.dll

Operating System - Windows XP, version 2002 Service Pack 3 (SP3), 32-bit.

+56
java java-8 dll windows-xp openjdk
Jan 07 '14 at 6:47
source share
5 answers

This is due to the fact that Oracle has lost support for Windows XP (by the way, it does not have RegDeleteKeyExA used by the installer in ADVAPI32.DLL ), as described in http://mail.openjdk.java.net/pipermail/openjfx-dev/ 2013-July / 009005.html . However, until official XP support has ended, Java binaries are still (like Java 8u20 EA b05, at least) compatible with XP - only the installer does not ...

Because of this, the solution is actually quite simple:

  • get 7-zip (or any other quality archiver), unzip the .exe distribution manually, it has one ZIP file inside it ( tools.zip ), extract it too,

  • use unpack200 from JDK8 to unpack all .pack files into .jar files (old decompressions will not work properly); JAVA_HOME environment variable must be set in your root package for unpacking Java, for example. "C: \ Program Files \ Java \ jdk8" - you can specify it implicitly, for example,

     SET JAVA_HOME=C:\Program Files\Java\jdk8 
    • Unzip all the files with one command (in a batch file):

       FOR /R %%f IN (*.pack) DO "%JAVA_HOME%\bin\unpack200.exe" -r -v "%%f" "%%~pf%%~nf.jar" 
    • Unzip all the files with one command (command from the root of the JRE):

       FOR /R %f IN (*.pack) DO "bin\unpack200.exe" -r -v "%f" "%~pf%~nf.jar" 
    • Unzip manually by placing the files and unpacking them one by one:

       %JAVA_HOME%\bin\unpack200 -r packname.pack packname.jar 

    where packname is, for example, rt

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

Note. You probably shouldn't do this simply by using Java 8 in your web browser or for any other reason (installing JRE 8 comes to mind); security flaws in the early versions of major releases of the Java versions (mind me) are legendary and, adding that no real support for either XP or Java 8 on XP not only significantly worsen the situation. Not to mention that you usually do not need Java in your browser (see for example http://nakedsecurity.sophos.com/2013/01/15/disable-java-browsers-homeland-security/ - the topic is already covered on many pages, just google if you need more info). In any case, AFAIK, the only thing required to apply this procedure to the JRE is to change some of the above paths from \ bin \ to \ lib \ (the location of the files in the installer directory tree is slightly different) - nevertheless, I strongly advise against to do this.

See also: How can I get the latest JRE / JDK as a zip file rather than an EXE or MSI installer? , JRE 1.7 returns: java / lang / NoClassDefFoundError: java / lang / Object

+69
Jan 18 '14 at 10:02
source share

There is also an alternative solution for those who are not afraid to use hexadecimal editors (for example, XVI32) [thanks to Trevor for this]: in the unpacked executable file of installer 1 ( jdk-8uXX-windows-i586.exe in JDK) it simply replaces all occurrences of RegDeleteKeyExA ( API name found in the "new" ADVAPI32.DLL ), with RegDeleteKeyA (deprecated API name) followed by two hex '00s (to preserve fill / segmentation boundaries), the Installer will complain about an unsupported version of Windows, but will still work .

For reference, raw hexadecimal strings will be:

 52 65 67 44 65 6C 65 74 65 4B 65 79 45 78 41 

replaced by

 52 65 67 44 65 6C 65 74 65 4B 65 79 41 00 00 

Note. This procedure applies to both standalone (standalone) and interactive (bootloader) packages.

1: some new installer versions are packaged with UPX - you first need to unzip them, otherwise you just wonโ€™t be able to find the required hexadecimal string

+19
Jun 28 '14 at 12:09 on
source share

Oracle Announces Fix for Windows XP Installation Error




I am adding this answer since Oracle decided to fix the installation of Windows XP. Regarding the release of JRE 8u25 on 10/15/2014, a bug has been fixed that prevented the installation of Windows XP.

However, this does not mean that Oracle continues to support Windows XP. They do not guarantee that current and future versions of JRE8 are compatible with Windows XP. It seems that this is a run at your own peril and risk.

See the Oracle blog here.

You can get JRE 8u25 (or the last one) right from the Oracle download site.

+14
Oct 27 '14 at 16:51
source share

There is another way with JRE 8 on XP - use MSI to deploy the package.

  • Install JRE 8 x86 on a PC with a supported OS.
  • Copy c: \ Users [USER] \ AppData \ LocalLow \ Sun \ Java \ jre1.8.0 \ jre1.8.0.msi and Data1.cab on XP PC and run jre1.8.0.msi

or (silent method used in a batch file, etc.)

 for %%I in ("*.msi") do if exist "%%I" msiexec.exe /i %%I /qn EULA=0 SKIPLICENSE=1 PROG=0 ENDDIALOG=0 
+6
Mar 27 '14 at 9:52
source share

Future-proof Installation Method for Java 8 on Win XP

  • Get the hex editor. A program called Hxd will work for this.
  • Download the Oracle Java 8 online installer called jre-8u11-windows-i586-iftw.exe (this is the smallest of the two Windows executables. Running it downloads the latest version of Java every time).

The latest version of Java can be obtained from this page, there is no direct link.

Java SE Runtime Environment 8 Downloads

http://www.oracle.com/technetwork/java/javase/downloads/jre8-downloads-2133155.html

  1. Open jre-8u11-windows-i586-iftw.exe (or a newer executable) using Hxd

  2. Search and replace (in hexadecimal mode) two occurrences of RegDeleteKeyExA and replace them with RegDeleteKeyA (deprecated API name). Remember to use hex mode:

Replace

52 65 67 44 65 6C 65 74 65 4B 65 79 45 78 41

from

52 65 67 44 65 6C 65 74 65 4B 65 79 41 00 00

  1. Save the file renamed to jre-8u11-windows-i586-iftw__Patched.exe

  2. Run the corrected program, if you corrected it correctly, it will complain that your OS is too old.

  3. Disable the popup and install Java 8. It will download the latest version of Java from Oracle every time it starts.

  4. Click on your desktop [Start], right-click "My Computer" and left-click on "Properties".

  5. Click the Advanced tab, and then the Environment Variables button. You do not need anything with the letters "java" in your PATH (a copy of java is installed in C:\WINDOWS\system32 , which is located in your PATH ). Clear all junk files from PATH , including java links (but obviously do not delete the C:\WINDOWS\system32 directory from your PATH variable).

Set the environment variable named JAVA_HOME (create it if necessary) in

 JAVA_HOME=C:\Program Files\Java\jre8 
  1. Now everything should be installed correctly. You may need to reboot, but before you do this, check step 11.

  2. If Java does not start (check with java -version), find the * .pack file, for example:

cd "c: \ Program Files \ java \"

dir / s * .pack

You can unpack them in one of these two ways:

  • Unzip all the files with one command (in a batch file):

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

  • Unzip all the files with one command (on the command line from the root of the JRE):

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

In the future, when you want to update Java, just run your patched program and it will select the latest copy of Java directly from Oracle and install it. There is no need to reinstall or set any environment variables (until you finish version 8 or want to use the JDK instead of the JRE).

This is a "fix - as soon as it should work for a while."

-2
Aug 10 '14 at 19:24
source share



All Articles