Changing default Java Runtime Environment from 1.8 to 1.7

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?

Cesar

Posted 2013-08-10T20:02:14.460

Reputation:

Add the content of your Launch4j error to the question. – Rob – 2013-08-10T23:52:44.010

Changing the registry seems like a valid solution without the crash message from the installer your question remains unclear – Ramhound – 2013-08-11T01:39:27.113

Answers

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

Kevin Norman

Posted 2013-08-10T20:02:14.460

Reputation: 31

Shouldn't changing JAVA_HOME be enough? Why the need to un-install JRE 8? – 6pack kid – 2016-05-23T02:07:36.960

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.

user3227986

Posted 2013-08-10T20:02:14.460

Reputation: 11

1Could you go into a little more detail on how the OP would go about setting these variables? – Burgi – 2016-05-23T08:25:19.833

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 – 2016-06-02T16:41:18.480

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

Lifebennder

Posted 2013-08-10T20:02:14.460

Reputation: 11

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 – 2016-02-25T13:02:08.057