We created a Jar File that supports two versions of JDK8 and JDK11 using the "Multi Release Jar Files with Maven" technology and executed it, but the following error appears.

Exception in thread "main" java.lang.UnsupportedClassVersionError: [our using module name] has been compiled by a more recent version of the Java Runtime(class version 54.0), this version of the Java Runtime only recognizes class file versions up to 52.0

This error seems to be caused by the existence of the version of the [our using module name] module to be used by each JDK version. Currently, I have specified the JDK Version to be used for Multi Release Jar Files in the Pom.xml file, and I tried to write the Version Properties of the module to be used, but an error in the Pom.xml file occurs. Can we specify the Module Version we will use for each JDK Version in the Pom.xml file? Or is there a better way?

0

There are 0 best solutions below