'Keycloak 18.0.0 Installation - Java error
I would like to install Keycloak on a Windows 10 machine. The installation guide can be found here: https://www.keycloak.org/getting-started/getting-started-zip After I have unzipped the file an run bin/kc.bat start-dev the following Java error appears:
"Error: A JNI error has occurred, please check your installation and try again Exception in thread "main" java.lang.UnsupportedClassVersionError: io/quarkus/bootstrap/runner/QuarkusEntryPoint has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0"
I am new to Java, what does it mean and how can I fix this issue? I already have checked installation guides on Youtube etc. but those are referring to a file, which is called "Standalone" which does not exist anymore.
I am using the following Java Distribution: java version "17.0.3.1" 2022-04-22 LTS Java(TM) SE Runtime Environment (build 17.0.3.1+2-LTS-6) Java HotSpot(TM) 64-Bit Server VM (build 17.0.3.1+2-LTS-6, mixed mode, sharing)
Any help, even link recommendations would be great.
Solution 1:[1]
You mention you have java version 17 installed, but it appears there is also a java version 8 installed on your machine (class file version 52.0)
Following the link you provided, that keycloak version requires at least java version 11 (class file version 55.0)
To set the proper java version on windows, set your JAVA_HOME environment variable to the full path of your required java version, ex: 'C:\Program Files\java\jre-17.0.3.1' (change this to the path on your system).
Also edit your PATH variable and add the '%JAVA_HOME%\bin' folder to it. Make sure there is only one java version in your PATH variable.
Verify which version is enabled in a CMD prompt by typing (open a new prompt after you make changes to your variables):
java --version
See details related to which class file version is related to which java version: java version vs class file version
Solution 2:[2]
Do you have created the media player?
axWindowsMediaPlayer1 = new AxWMPLib.AxWindowsMediaPlayer();
axWindowsMediaPlayer1.CreateControl();
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | gna |
| Solution 2 | Michael Insberg |
