3

I'm currently trying to change the default JRE on my computer from 8 to 7.

I was attempting to fix a glitch involving the game Minecraft by updating to the JRE8 beta build, but it seems like that installer was corrupted and stopped midway before crashing. Now, whenever I try to launch any Java related program, it keeps on pointing to JRE8 even though it's installed. I attempted to reinstall it but the launcher doesn't seem to launch anymore even after I redownloaded it and tried several other builds.

I applied a temporary band-aid fix by either copying my JRE7 folder, pasting it, and renaming it to JRE8. Or I can also go into the registry and change the 1.8.0 registry (HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Runtime Environment\1.8.0) to point to the JRE7 folder instead of the JRE8 folder. If none of these two "fixes" are applied, I get a Launch4j error when I attempt to launch anything Java related:

enter image description here

How can I fix this?

2
  • Add the content of your Launch4j error to the question.
    – Rob
    Aug 10, 2013 at 23:52
  • Changing the registry seems like a valid solution without the crash message from the installer your question remains unclear
    – Ramhound
    Aug 11, 2013 at 1:39

3 Answers 3

3

Try:

Remove JRE 8

  1. Go to Uninstall a Program in your computers Control Panel
  2. Uninstall JRE 8

Install JRE 7

  1. Download JRE 7
  2. Install JRE 7

Update your Computer's JAVA_HOME system variable

  1. Right Click on Computer in the start menu
  2. Select Properties in the Drop down
  3. Click on Advanced System Settings
  4. Click on Environmental Variable under the Advanced Tab
  5. Under System Variables click New
  6. For Variable Name: write "JAVA_HOME" without quotations
  7. For Variable Value: write your computers path to the new install of JRE 7
  8. Click Okay, then Click Okay Again
  9. Restart the computer

Hopefully that helps, it worked for my downgrade from Java 8 to Java 7

1
  • Shouldn't changing JAVA_HOME be enough? Why the need to un-install JRE 8?
    – Aaron S
    May 23, 2016 at 2:07
1

You have to add the java 7 folder into the Path. No need to reinstall.

Start-> type and open "Edit the System environmental Variables" -> envriornmental variables then locate the Path variable in the system variables.

check that in the Path variable you dont have java 8 location: C:\Program Files\Java\jre1.8.0_31\bin

but make sure its C:\Program Files\Java\jdk1.7.0_51\bin

1
  • I already changed JAVA_HOME to 1.7 jdk, also PATH contains value derived from JAVA_HOME. In control panel Java applet I disabled 1.8 java jdk and jre and anyway java -version gives me 1.8.0_71
    – 4xy
    Feb 25, 2016 at 13:02
1

It happens when there are two variable for PATH one for user environment variables and other for system environment variable. If one of them is pointing to java 1.8 and other pointing to java 1.7 which leads to an ambiguity. So creating a JAVA_HOME variable for both system and user and configuring this in PATH of user and system environment variables would resolve this issue.

Then javac -version or java -version in command line gives the version of java which is configured in JAVA_HOME.

The above approach solves the issue for me.

2
  • 1
    Could you go into a little more detail on how the OP would go about setting these variables?
    – Burgi
    May 23, 2016 at 8:25
  • For Windows 7, go to Control Panel\System and Security\System , click "Advanced System Settings" on the left, and click "Environment Variables." This shows you the PATH and JAVA_HOME variables. Other modern versions of Windows are similar.
    – ChimneyImp
    Jun 2, 2016 at 16:41

You must log in to answer this question.