Configuring Java on Windows or UNIX
Caused by: java.lang.UnsupportedClassVersionError: AdminClient/AdminServiceService 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 (unable to load class [AdminClient.AdminServiceService] )
- Procedure
- Set the
JAVA_HOME environment variable to point to the
Java\jdk directory.
For example,
On Windows:set
JAVA_HOME=C:\Program Files\Java\jdk-12.0.1
On UNIX:export
JAVA_HOME=/opt/java/jdk-12.0.1
- Set the
PATH
variable to point to the
Java\bin directory:
For example,
On Windows:set PATH=%JAVA_HOME%\bin:%PATH%
or
set PATH=C:\Program Files\Java\jdk-12.0.1\bin;%PATH%
On UNIX:export PATH=$JAVA_HOME/bin:$PATH
or
export PATH=/opt/java/jdk-12.0.1/bin:$PATH
- Verify that the path is correctly set by using the following command:
Windows and UNIX:
java –version
See the following sample output:
java version "12.0.1" 2019-04-16 Java(TM) SE Runtime Environment (build 12.0.1+12) Java HotSpot(TM) 64-Bit Server VM (build 12.0.1+12, mixed mode, sharing)