The 'Future-Proof' Method of installing Java 8 on Win XP
- Obtain a hex editor. The program called Hxd will work for this.
- 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
Open jre-8u11-windows-i586-iftw.exe
(or a newer executable) using Hxd
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
Save the File renamed as jre-8u11-windows-i586-iftw__Patched.exe
Run the patched Program, if you patched it correctly it will complain that your OS is too old.
Dismiss the Popup and install Java 8. The Online Installer will download the newest version of Java from Oracle each time you run it.
Click on your Desktop's [Start] Button, right-click on "My Computer" and left-click on "Properties".
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
Everything should now be installed properly. You may need to reboot, but check Step 11 before you do.
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.