61

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.

7
  • I don't think Java 8 supports XP.
    – assylias
    Commented Jan 7, 2014 at 10:03
  • @assylias is it so? is there any document specifying it?
    – yashhy
    Commented Jan 7, 2014 at 10:05
  • I tried installing it on an XP computer a few months ago and I remember getting a warning (the installation went through though...).
    – assylias
    Commented Jan 7, 2014 at 10:11
  • 1
    @assylias I was looking through google and found msdn.microsoft.com/en-us/library/ms724847%28VS.85%29.aspx where minimum client requirement for RegDeleteKeyExA is Windows Vista, Windows XP Professional x64 Edition so this could be the problem.
    – yashhy
    Commented Jan 7, 2014 at 11:21
  • 1
    @yashhy There are two factors that seal the deal in this situation. 1) Java 8 will be released in a few months, and 2) Microsoft is ending support for XP in 3 months. There is no time, and no point. Commented Jan 9, 2014 at 20:28

4 Answers 4

78

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. get 7-Zip (or any other good unpacker), unpack the distribution .exe manually, it has one .zip file inside of it (tools.zip), extract it too,

  2. 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 example rt

  3. 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 - java version - returns: java/lang/NoClassDefFoundError: java/lang/Object

8
  • I screwed up the upack200 cmd line and renamed all the files .pack.jar , use FOR /R %%f IN (*.pack) DO "C:\Program Files\Java\jre8\bin\unpack200.exe" -r -v "%%f" "%%~pf%%~nf.jar" Trying it again now.
    – brian
    Commented Feb 2, 2014 at 16:44
  • Everything works, thanks. I also downloaded the jre and did the same thing and replaced my jre8 program dir. You could probably just use the jre dir in the sdk. There's some registry entries with the old version number but it's probably no big deal. java -version returns the correct build.
    – brian
    Commented Feb 2, 2014 at 16:57
  • Strange because i cannot locate src.zip from jdk and so eclipse cannot attach the source code. Commented Mar 19, 2014 at 17:25
  • Actually, as far as I know, there ain't any src.zip in those Early Access JDKs for core Java (only for Java FX) - at least I couldn't find any in mine... You can still get the source package separately from (AFAIR) OpenJDK or Oracle's download (it was there somewhere)
    – user719662
    Commented Mar 19, 2014 at 20:51
  • For all those having problems with the unpack200, I'd like to clarify that it is an executable inside the bin folder of the jdk. You'll have errors if you try to use the version included in jdk6 or 7 to unpack the jd8 pack files. This might happen if you dont have the JAVA_HOME variable pointing to the new jdk8. You have to use the unpack200 version included in the new jdk you are installing. Commented Mar 20, 2014 at 9:17
23

There is also an alternate solution for those who aren't afraid of using hex editors (e.g. XVI32) [thanks to Trevor for this]: in the unpacked 1 installer executable (jdk-8uXX-windows-i586.exe in case of JDK) simply replace all occurrences of RegDeleteKeyExA (the name of API found in "new" ADVAPI32.DLL) with RegDeleteKeyA (legacy API name), followed by two hex '00's (to preserve padding/segmentation boundaries). The installer will complain about unsupported Windows version, but will work nevertheless.

For reference, the raw hex strings will be:

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

replaced with

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

Note: this procedure applies to both offline (standalone) and online (downloader) package.

1: some newer installer versions are packed with UPX - you'd need to unpack them first, otherwise you simply won't be able to find the hex string required

3
  • 3
    I must admit, I tried this rather than the accepted answer even though I had my doubts, simply because its way easier to do, so why not try it out? -- totally works. Thanks! Commented Jul 25, 2014 at 20:16
  • 2
    Hi! this is very easy. It worked for me also. in XVI32 find 52 65 67 44 65 6C 65 74 65 4B 65 79 45 78 41 in hex and replace with 52 65 67 44 65 6C 65 74 65 4B 65 79 41 00 00. Only two occurrence in that file to replace. Commented Aug 15, 2014 at 13:22
  • Love this solution.
    – Zhro
    Commented Nov 5, 2020 at 14:03
18

Oracle has announced fix for Windows XP installation error

Oracle has decided to fix Windows XP installation. As of the JRE 8u25 release in 10/15/2014 the code of the installer has been changes so that installation on Windows XP is again possible.

However, this does not mean that Oracle is continuing to support Windows XP. They make no guarantee about current and future releases of JRE8 being compatible with Windows XP. It looks like it's a run at your own risk kind of thing.

See the Oracle blog post here.

You can get the latest JRE8 right off the Oracle downloads site.

6

With JRE 8 on XP there is another way - to use MSI to deploy package.

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

or (silent way, usable in batch file etc..)

for %%I in ("*.msi") do if exist "%%I" msiexec.exe /i %%I /qn EULA=0 SKIPLICENSE=1 PROG=0 ENDDIALOG=0
7
  • Since it actually requires the JRE to be installed on another, spec-compliant system (not to mention it requires copying the files from it), I consider this method a (interesting one, so to say) proof-of-concept - rather than a working, usable solution.
    – user719662
    Commented Mar 27, 2014 at 21:59
  • @vaxquis, I'm sure one can use 7z or similar to extract the jre1.8.0.msi file directly from the setup.exe
    – Sebastian
    Commented Jun 25, 2014 at 7:28
  • @SebastianGodelet first, there's no setup.exe, only jdk-8uXX-windows-i586.exe, secondly, it contains only tools.zip, which, in turn, doesn't contain neither jre1.8.0.msi nor data1.cab; if the installation was possible by simple setup.exe extraction, why do you think I'd even invent the whole solution? Instead of "being sure" try doing it youself to figure if it is possible; if you manage to do it your way, post it as a solution here.
    – user719662
    Commented Jun 25, 2014 at 9:34
  • BTW, I haven't even checked this method (jre1.8.0.msi copying), but I must assume the relevant files are build by the installer itself, as I couldn't locate them in the tools.zip in any way.
    – user719662
    Commented Jun 25, 2014 at 9:35
  • First, WTF is an offensive phrase, please don't use vulgar and/or obscene wording/acronyms on StackOverflow. Secondly, posting a non-working solution is not being helpful; to paraphrase Yoda - "don't try to be helpful; either be helpful, or don't try". Third thing, "setup.exe" is not a synonym for anything - either be precise and specify the filename in question or say, e.g., "setup exe", "setup executable" etc.
    – user719662
    Commented Jun 28, 2014 at 11:58

Not the answer you're looking for? Browse other questions tagged or ask your own question.