在这里,我使用Maven 3.2.5运行JDK-8,我的代码构建已经成功
启动应用程序后,我得到以下错误:
Caused by: java.lang.UnsupportedClassVersionError: com/daimler/duke/common/faults/CommonServiceFacadeFault has been compiled by a more recent version of the Java Runtime (class file version 53.0), this version of the Java Runtime only recognizes class file versions up to 52.0
at java.lang.ClassLoader.defineClass1(Native Method) ~[na:1.8.0_162]我也对此进行了研究,一些博客显示,应用程序是用java 9编译的,并且它试图在java 8中运行。
我的pom.xml文件是:
<project>
.............
.............
<properties>
<tycho.version>1.2.0</tycho.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<repositories>
...........
</repositories>
<pluginRepositories>
...........
</pluginRepositories>
<build>
<plugins>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>target-platform-configuration</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jarsigner-plugin</artifactId>
</plugin>
</plugins>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-maven-plugin</artifactId>
<version>${tycho.version}</version>
<extensions>true</extensions>
</plugin>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>target-platform-configuration</artifactId>
<version>${tycho.version}</version>
<configuration>
<environments>
<environment>
<os>win32</os>
<ws>win32</ws>
<arch>x86_64</arch>
</environment>
</environments>
<dependency-resolution>
<extraRequirements>
<requirement>
<type>eclipse-plugin</type>
<id>org.eclipse.core.runtime</id>
<versionRange>0.0.0</versionRange>
</requirement>
<requirement>
<type>eclipse-plugin</type>
<id>org.eclipse.ui.ide</id>
<versionRange>0.0.0</versionRange>
</requirement>
</extraRequirements>
</dependency-resolution>
</configuration>
</plugin>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-packaging-plugin</artifactId>
<version>${tycho.version}</version>
</plugin>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-compiler-plugin</artifactId>
<configuration>
<compilerArgument>-warn:none</compilerArgument>
<compilerArgument>-err:none</compilerArgument>
<useProjectSettings>false</useProjectSettings>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
</project>有人知道这事吗?
注意:由于应用程序依赖关系,我不能在这里使用java 9。
发布于 2020-11-26 23:00:56
一旦修复了JDK版本问题,就需要运行clean任务来重新编译所有类:
mvn clean package如果不添加clean,一些类就不会编译,错误也会持续存在。
https://stackoverflow.com/questions/55179819
复制相似问题