java依赖包限制

jdk限制

java低版本的项目不能依赖高版本的程序包;java高版本项目可以依赖低版本的程序包;
如果依赖错误会报如下错误:

Exception in thread "main" java.lang.UnsupportedClassVersionError: org/example/Package17 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:763)
	at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
	at java.net.URLClassLoader.defineClass(URLClassLoader.java:467)
	at java.net.URLClassLoader.access$100(URLClassLoader.java:73)

你可能感兴趣的:(java,开发语言)