Java 运行时错误 class 文件版本错误
Java Runtime Error with class file version error
我几乎下载了每个 JDBC 驱动程序版本以及 JAVA 的多个版本。
每次我尝试 运行 SchemaSpy 时,我都会收到以下错误:
Exception in thread "main" java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:48)
at org.springframework.boot.loader.Launcher.launch(Launcher.java:87)
at org.springframework.boot.loader.Launcher.launch(Launcher.java:50)
at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:51)
Caused by: java.lang.UnsupportedClassVersionError: com/microsoft/sqlserver/jdbc/SQLServerDriver has been compiled by a more recent version of the Java Runtime (class file version 57.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(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access0(Unknown Source)
at java.net.URLClassLoader.run(Unknown Source)
at java.net.URLClassLoader.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at org.schemaspy.input.dbms.DbDriverLoader.getDriverClass(DbDriverLoader.java:170)
at org.schemaspy.input.dbms.DbDriverLoader.getDriver(DbDriverLoader.java:144)
at org.schemaspy.input.dbms.DbDriverLoader.getConnection(DbDriverLoader.java:93)
at org.schemaspy.input.dbms.DbDriverLoader.getConnection(DbDriverLoader.java:75)
at org.schemaspy.input.dbms.service.SqlService.connect(SqlService.java:70)
at org.schemaspy.SchemaAnalyzer.analyze(SchemaAnalyzer.java:220)
at org.schemaspy.SchemaAnalyzer.analyze(SchemaAnalyzer.java:123)
at org.schemaspy.cli.SchemaSpyRunner.runAnalyzer(SchemaSpyRunner.java:98)
at org.schemaspy.cli.SchemaSpyRunner.run(SchemaSpyRunner.java:87)
at org.schemaspy.Main.main(Main.java:55)
... 8 mor
关于如何解决这个问题有什么想法吗?
@texnoob 我在尝试使用旧数据库类型 运行 SchemaSpy 时看到了这一点。对于更高版本的 SQL 服务器,请尝试使用 -t mssql08
而不是 -t mssql
。
运行 带有 -dbhelp
命令行开关的 SchemaSpy 应该 return 支持类型,但它对我不起作用。另一种查找类型的方法是在允许浏览存档的应用程序(WinZip、WinRAR 等)中打开 SchemaSpy JAR 文件。打开后,您将在路径“BOOT-INF\classes\org\schemaspy\types”中找到列出的数据库类型。
如果更改数据库类型仍然不起作用,请提供您发出的命令行语句以供进一步分析。
我几乎下载了每个 JDBC 驱动程序版本以及 JAVA 的多个版本。
每次我尝试 运行 SchemaSpy 时,我都会收到以下错误:
Exception in thread "main" java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:48)
at org.springframework.boot.loader.Launcher.launch(Launcher.java:87)
at org.springframework.boot.loader.Launcher.launch(Launcher.java:50)
at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:51)
Caused by: java.lang.UnsupportedClassVersionError: com/microsoft/sqlserver/jdbc/SQLServerDriver has been compiled by a more recent version of the Java Runtime (class file version 57.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(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access0(Unknown Source)
at java.net.URLClassLoader.run(Unknown Source)
at java.net.URLClassLoader.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at org.schemaspy.input.dbms.DbDriverLoader.getDriverClass(DbDriverLoader.java:170)
at org.schemaspy.input.dbms.DbDriverLoader.getDriver(DbDriverLoader.java:144)
at org.schemaspy.input.dbms.DbDriverLoader.getConnection(DbDriverLoader.java:93)
at org.schemaspy.input.dbms.DbDriverLoader.getConnection(DbDriverLoader.java:75)
at org.schemaspy.input.dbms.service.SqlService.connect(SqlService.java:70)
at org.schemaspy.SchemaAnalyzer.analyze(SchemaAnalyzer.java:220)
at org.schemaspy.SchemaAnalyzer.analyze(SchemaAnalyzer.java:123)
at org.schemaspy.cli.SchemaSpyRunner.runAnalyzer(SchemaSpyRunner.java:98)
at org.schemaspy.cli.SchemaSpyRunner.run(SchemaSpyRunner.java:87)
at org.schemaspy.Main.main(Main.java:55)
... 8 mor
关于如何解决这个问题有什么想法吗?
@texnoob 我在尝试使用旧数据库类型 运行 SchemaSpy 时看到了这一点。对于更高版本的 SQL 服务器,请尝试使用 -t mssql08
而不是 -t mssql
。
运行 带有 -dbhelp
命令行开关的 SchemaSpy 应该 return 支持类型,但它对我不起作用。另一种查找类型的方法是在允许浏览存档的应用程序(WinZip、WinRAR 等)中打开 SchemaSpy JAR 文件。打开后,您将在路径“BOOT-INF\classes\org\schemaspy\types”中找到列出的数据库类型。
如果更改数据库类型仍然不起作用,请提供您发出的命令行语句以供进一步分析。