The popup hides the real error: javaw.exe has no console.
Open a terminal and run: java -jar app.jar
Most common result: UnsupportedClassVersionError: the jar was built with a newer Java than the one running it.
Class file version - 44 = Java version (52 = Java 8, 55 = 11, 61 = 17, 65 = 21).
java -version shows the default Java; where java lists every java.exe on PATH (first wins).
Fix: run it with the newer Java's full path, put that Java first on PATH, or remove the old one.
✦ Definition~90s read
What is A Java Exception Has Occurred?
'A Java Exception has occurred' is the Java Virtual Machine Launcher popup shown when a program started with javaw.exe (what double-clicking a .jar on Windows uses) fails during startup. javaw has no console, so the actual exception isn't shown. Running the same jar with java -jar in a terminal prints it.
★
It's a car dashboard that only says 'Problem'.
Plain-English First
It's a car dashboard that only says 'Problem'. Plug in the diagnostic cable (run it from a terminal) and it tells you exactly what's wrong.
Double-click a jar, get a box that says 'A Java Exception has occurred', and nothing else. Reinstalling Java often doesn't help, because the problem is usually which Java runs, not whether Java is installed. The first step is always to see the real error.
Why the Popup Says Nothing
Windows opens .jar files with javaw.exe, the console-less launcher. When startup throws, the message would go to a console that doesn't exist, so you get a generic box.
run.batBAT
1
java -jar app.jar
Output
Error: LinkageError occurred while loading main class app.Main
java.lang.UnsupportedClassVersionError: app/Main has been compiled by a more recent version of the Java Runtime (class file version 65.0), this version of the Java Runtime only recognizes class file versions up to 52.0
🎯 Key Takeaway
javaw has no console.
Built Newer, Run Older
A class compiled for Java 21 has class file version 65. Java 8 only reads up to 52. Subtract 44 to get the Java version.
versions.txtTEXT
1
2
3
4
52 = Java855 = Java1161 = Java1765 = Java21
🎯 Key Takeaway
Class version - 44 = Java version.
Which Java Runs?
Windows runs the first java.exe on PATH. Old installers add C:\Oracle\Java\javapath early, so an old Java can win even with a newer one installed.
check.batBAT
1
2
3
java -version
where java
javap -v -cp app.jar app.Main | findstr major
🎯 Key Takeaway
First on PATH wins.
Fix It
Run the jar with the newer Java's full path, put that Java first on PATH (or set JAVA_HOME and its bin first), or uninstall the old Java.