0

Here I'm running JDK-8 with Maven 3.2.5, my code build is getting success

After launching the app I'm getting the following error:

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]

I have also explored about it, some of the blogs are showing that application is getting compiled in java 9 and its try to run in java 8

My pom.xml file is:

<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>

Any one have idea about this?

Note: I can not go with the java 9 here because of application dependencies.

Hasitha Jayawardana
  • 2,326
  • 4
  • 18
  • 36
Ashwani
  • 485
  • 2
  • 9
  • 23

1 Answers1

0

Once you have fixed the JDK version issue, you need to run clean task for recompiling all classes:

mvn clean package

If you don't add clean some classes don't get compiled and error persists.

Eneko
  • 1,709
  • 1
  • 16
  • 25