Maven Compilation failure class file has wrong version 50.0, should be 49.0
Adrien Ruffie
Ranch Hand
Joined: Jan 14, 2009
Posts: 71
posted
0
Hello, I try to package a webapp with maven but for java 1.5.
But during the maven packaging I get the following error:
WARNING] File encoding has not been set, using platform encoding UTF-8, i.e. build is platform dependent!
[INFO] Compiling 73 source files to /home/aruffie/Java/Projects/Petals/petals/trunk/petals-webconsole/target/classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /home/aruffie/Java/Projects/Petals/petals/trunk/petals-webconsole/src/main/java/org/ow2/petals/tools/webconsole/uibeans/ManagementUIBean.java:[37,-1] cannot access org.ow2.petals.jmx.exception.RuntimeConfigurationDoesNotExistException
bad class file: /home/aruffie/.m2/repository/org/ow2/petals/petals-jmx/1.7-SNAPSHOT/petals-jmx-1.7-SNAPSHOT.jar(org/ow2/petals/jmx/exception/RuntimeConfigurationDoesNotExistException.class)
class file has wrong version 50.0, should be 49.0
[INFO] 1error
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Compilation failure
/home/aruffie/Java/Projects/Petals/petals/trunk/petals-webconsole/src/main/java/org/ow2/petals/tools/webconsole/uibeans/ManagementUIBean.java:[37,-1] cannot access org.ow2.petals.jmx.exception.RuntimeConfigurationDoesNotExistException
bad class file: /home/aruffie/.m2/repository/org/ow2/petals/petals-jmx/1.7-SNAPSHOT/petals-jmx-1.7-SNAPSHOT.jar(org/ow2/petals/jmx/exception/RuntimeConfigurationDoesNotExistException.class)
class file has wrong version 50.0, should be 49.0
[INFO] ------------------------------------------------------------------------
[DEBUG] Trace
org.apache.maven.BuildFailureException: Compilation failure
/home/aruffie/Java/Projects/Petals/petals/trunk/petals-webconsole/src/main/java/org/ow2/petals/tools/webconsole/uibeans/ManagementUIBean.java:[37,-1] cannot access org.ow2.petals.jmx.exception.RuntimeConfigurationDoesNotExistException
bad class file: /home/aruffie/.m2/repository/org/ow2/petals/petals-jmx/1.7-SNAPSHOT/petals-jmx-1.7-SNAPSHOT.jar(org/ow2/petals/jmx/exception/RuntimeConfigurationDoesNotExistException.class)
class file has wrong version 50.0, should be 49.0
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:699)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:540)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:519)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:371)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:332)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:181)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:356)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:137)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:356)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by: org.apache.maven.plugin.CompilationFailureException: Compilation failure
/home/aruffie/Java/Projects/Petals/petals/trunk/petals-webconsole/src/main/java/org/ow2/petals/tools/webconsole/uibeans/ManagementUIBean.java:[37,-1] cannot access org.ow2.petals.jmx.exception.RuntimeConfigurationDoesNotExistException
bad class file: /home/aruffie/.m2/repository/org/ow2/petals/petals-jmx/1.7-SNAPSHOT/petals-jmx-1.7-SNAPSHOT.jar(org/ow2/petals/jmx/exception/RuntimeConfigurationDoesNotExistException.class)
class file has wrong version 50.0, should be 49.0
at org.apache.maven.plugin.AbstractCompilerMojo.execute(AbstractCompilerMojo.java:613)
at org.apache.maven.plugin.CompilerMojo.execute(CompilerMojo.java:116)
at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:483)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:678)
... 16 more
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 5 seconds
[INFO] Finished at: Fri Apr 09 11:04:59 CEST 2010
[INFO] Final Memory: 12M/22M
[INFO] ------------------------------------------------------------------------
Unfortunately, the last previous version of my petals-jmx was packaged with java 1.6, therefore, I
repackage my petals-jmx.jar with java 1.5 (logic ...)
I have try to delete it into .m2/repository ... but, nothing to do the problem persist