Java (JRE) refuses to install? Exit Code:2 Fix Fix [Java] [Launcher]
I just got a new laptop and naturally it doesn't have any java installed
So after I downloaded the launcher and tried running java "could not find java.dll" and "could not find Java SE Runtime Environment" errors popped with "Exit Code:2"
Normally I googled this error to see what to do and in every single tutorial video you go and download the latest JRE from "https://www.java.com/en/download/"
Now this is where the actual starts because after I download the installation .exe file it does not work. Like it does not run at all. I run it as admin and then I click it windows asks the usual allow to make changes I click yes and the .exe just refuses to elaborate. The only thing that follows is the cursor loading for a second or so.
As it should be I then googled fixes for "Java Setup not opening" and the suggestions were something along the lines of:
- Disable any antivirus or firewall which may be blocking the app
- Clear any leftovers from the previous java versions (there are none though i still did this)
- Download from different links
- Download different versions
- Run it from cmd
- Download a JDK
- Reinstall MC launcher
There may be some which I forgot because I literally did ANYTHING that came up.
Including resetting windows (11) altogether.
No matter what after doing all this and spending hours to be able to run MC java I only found more fixes which doesn't work.
The only fix which did something was installing java through a Ninite which kind of worked?
It did install the JRE and it was visible in installed apps and the "java -version" and "where java" commands ran successfully in cmd but it did not fix the "java.dll" issue.
After that I couldn't find any elaborate fixes but I tried setting the java path manually from the launcher which also did not work.
After all of this the only way of solution left was changing some kind of variables from a control panel which I know absolutely nothing about i decided to give up and look for actual help. Might just toss my pc to a local computer engineer atm.
Posted May 24, 2026, 8:09 PM UTC