Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

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.

share|improve this question
    
I don't think Java 8 supports XP. –  assylias Jan 7 '14 at 10:03
    
@assylias is it so? is there any document specifying it? –  yashhy Jan 7 '14 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 Jan 7 '14 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 Jan 7 '14 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. –  Aleksandr Dubinsky Jan 9 '14 at 20:28

5 Answers 5

up vote 66 down vote accepted

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 quality archiver), 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 returns: java/lang/NoClassDefFoundError: java/lang/Object

share|improve this answer
    
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 Feb 2 '14 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 Feb 2 '14 at 16:57
    
Strange because i cannot locate src.zip from jdk and so eclipse cannot attach the source code. –  Wlofrevo Kcast Mar 19 '14 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) –  vaxquis Mar 19 '14 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. –  Mister Smith Mar 20 '14 at 9:17

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

share|improve this answer
1  
This worked, Thanks! –  bfritz Jul 14 '14 at 19:57
    
Yes, it worked. Just to mention that we have to edit jdk-8-windows-i586.exe file not advapi32.dll. –  Ernestas Gruodis Jul 24 '14 at 20:49
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! –  Brent Larsen Jul 25 '14 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. –  catmantiger Aug 15 '14 at 13:22
2  
This no longer works with the latest version, which is the first ever Java installer I know of to be UPX compressed, unless one first uses UPX to decompress it. (I expect the next version after they stumble upon this comment to be encrypted with a polymorphic engine, possibly being then recognized as a virus ]:-D ) –  lserni Jan 30 at 17:23

Oracle has announced fix for Windows XP installation error


I'm adding this answer since Oracle has decided to fix Windows XP installation. As of the JRE 8u25 release in 10/15/2014 the bug has been fixed that prevented Windows XP installation.

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 JRE 8u25(Or the latest) right off the Oracle downloads site.

share|improve this answer

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
share|improve this answer
    
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. –  vaxquis Mar 27 '14 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 Godelet Jun 25 '14 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. –  vaxquis Jun 25 '14 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. –  vaxquis Jun 25 '14 at 9:35
    
WTF, I's just trying to be helpful, btw, "setup.exe" is IMHO a well established synonym for the installer file. The method I used was: inbytebg.com/techblog/?p=189#comment-772 there the relevant registry call is replaced with the "normal" version –  Sebastian Godelet Jun 26 '14 at 11:13

The 'Future-Proof' Method of installing Java 8 on Win XP

  1. Obtain a hex editor. The program called Hxd will work for this.
  2. Download the Oracle Java 8 Online Installer called jre-8u11-windows-i586-iftw.exe (it is the smallest of the two Windows Executables. Running it downloads the latest Java version each time).

The most recent 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 Hex Mode) the two occurrences of RegDeleteKeyExA and replace them with RegDeleteKeyA (the legacy API name). Remember to use hex mode:

Replace

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

with

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

  1. Save the File renamed as jre-8u11-windows-i586-iftw__Patched.exe

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

  3. Dismiss the Popup and install Java 8. The Online Installer will download the newest version of Java from Oracle each time you run it.

  4. Click on your Desktop's [Start] Button, right-click on "My Computer" and left-click on "Properties".

  5. Click on 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 in your PATH). Clean all the junk from your PATH including references to java (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) to

JAVA_HOME=C:\Program Files\Java\jre8
  1. Everything should now be installed properly. You may need to reboot, but check Step 11 before you do.

  2. If Java does not start (test with "java -version") then look for *.pack Files like this:

cd "c:\Program Files\java\"

dir /s *.pack

You can unpack them via one of these two methods:

  • 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 "%JAVA_HOME%\bin\unpack200.exe" -r -v "%f" "%~pf%~nf.jar"

In the future when you want to update Java just re-run your patched Program and it will fetch the newest copy of Java direct from Oracle and install it. No need to re-patch or set any Environment Variables (until you get past version 8, or wish to use the JDK instead of the JRE).

This is a "fix-once it should work for a while" Solution.

share|improve this answer
1  
-1, since your "solution" only blatantly copies the information already present in other answers... for more than 6 months already. Also, as already stated running an unsupported JRE is a very bad idea; making it more automated or newbie-friendly is a bad idea for the very same reasons. –  vaxquis Aug 18 '14 at 18:24
    
for further reference: stackoverflow.com/questions/24943927/… –  vaxquis Aug 18 '14 at 19:43
    
My Solution suggests using the Online Installer instead of the Offline Installer. No prior Solution suggests that nor would most people think that the same method would work on a different Executable and produce a similar result. Unless someone requests information to cause harm to others I see no reason we can not offer advice against doing it and still be correct (within our Mandates) to offer the means to do it should the person so choose. This answer is even more relevant (timely) as time passes and the requirement to update Java, by some Programs (Nightly comes to mind), pops up. –  Rob Aug 21 '14 at 3:55
    
so called "online installer" is simply a downloader, and after the download the procedure is exactly the same as in described cases. Your statement "nor would most people think that the same method would work on a different Executable and produce a similar result" is unsourced - are you most people? No, you're a single person. Most sensible people with desire to use online installer would first try to apply the exact procedure, because that's the reasonable extrapolation. Nobody explicitly mentioned offline vs online installation - the procedure is generic, and that's the reason –  vaxquis Aug 21 '14 at 12:02
2  
Oracle has updated the Installer, patching is no longer needed. I can install JDK or JRE version 8, Update 25 on Windows XP. There is the same warning popup as before. Upon verifying that it works with the "Verify Java" URL I can state that it works with Chrome, FF Release, and Aurora; but Nightly has a Bug Report filed regarding startup. –  Rob Oct 22 '14 at 21:57

protected by Community Apr 4 '14 at 12:12

Thank you for your interest in this question. Because it has attracted low-quality answers, posting an answer now requires 10 reputation on this site.

Would you like to answer one of these unanswered questions instead?

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