测试JDK8 JDK17编译包
当前环境JDK8
CASE 1:
/**
*
* @author ZengWenFeng
* @email 117791303@QQ.com
* @mobile 13805029595
* @date 2023-08-07
*/
package zwf;
import a.T;
import ce.pub.util.GUID;
/**
* 测试高版本JDK编译JAR,低版本错误
*
* @author ZengWenFeng
* @email 117791303@QQ.com
* @mobile 13805029595
* @date 2023-08-07
*/
public class Test
{
/**
*
* @author ZengWenFeng
* @email 117791303@QQ.COM
* @mobile 13805029595
* @date 2023.08.07
*/
public static void main(String[] args)
{
//ce.pub.util.GUID 公司架构包
System.out.println(GUID.newGUID());//JavaFramework-JDK17.jar 引用旧工程打包
T.test(1, 2);//TestClazzVersion-JDK17.jar 引用全新开发环境下17打包编译的
}
/**
*
*
*
DAB24512CFF2368D72F3997F2257F7F8
Exception in thread "main" java.lang.UnsupportedClassVersionError: a/T has been compiled by a more recent version of the Java Runtime (class file version 61.0), this version of the Java Runtime only recognizes class file versions up to 52.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:756)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:473)
at java.net.URLClassLoader.access$100(URLClassLoader.java:74)
at java.net.URLClassLoader$1.run(URLClassLoader.java:369)
at java.net.URLClassLoader$1.run(URLClassLoader.java:363)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:362)
at java.lang.ClassLoader.loadClass(ClassLoader.java:418)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:355)
at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
at zwf.Test.main(Test.java:34)
*
*
*/
}
java.lang.UnsupportedClassVersionError_spencer_tseng的博客-CSDN博客
CASE 2: