You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Benoît Berthonneau (JIRA)" <ji...@apache.org> on 2017/12/15 21:02:00 UTC
[jira] [Comment Edited] (MCOMPILER-319) Maven Compiler not
compatible with Java 1.6
[ https://issues.apache.org/jira/browse/MCOMPILER-319?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16293107#comment-16293107 ]
Benoît Berthonneau edited comment on MCOMPILER-319 at 12/15/17 9:01 PM:
------------------------------------------------------------------------
Hi Robert, even if the required version is visible on the summary page, nothing is mentionned on the [Introduction page|https://maven.apache.org/plugins/maven-compiler-plugin/]! This page is still indicating stuff on Java 1.5: "_Also note that at present the default source setting is 1.5 and the default target setting is 1.5, independently of the JDK you run Maven with. If you want to change these defaults, you should set source and target as described in Setting the -source and -target of the Java Compiler._"
At least, I expect a more visible explanation on the incompatibility...
Could you please say us what is the last version of the plugin compatible with Java 1.6 (if we want to avoid the use of the toolchain workaround) ?
Thx
was (Author: bbe):
bq. Hi Robert, even if the required version is visible on the summary page, nothing is mentionned on the [Introduction page|https://maven.apache.org/plugins/maven-compiler-plugin/]! This page is still indicating stuff on Java 1.5: "_Also note that at present the default source setting is 1.5 and the default target setting is 1.5, independently of the JDK you run Maven with. If you want to change these defaults, you should set source and target as described in Setting the -source and -target of the Java Compiler._"
At least, I expect a more visible explanation on the incompatibility...
Could you please say us what is the last version of the plugin compatible with Java 1.6 (if we want to avoid the use of the toolchain workaround) ?
Thx
> Maven Compiler not compatible with Java 1.6
> -------------------------------------------
>
> Key: MCOMPILER-319
> URL: https://issues.apache.org/jira/browse/MCOMPILER-319
> Project: Maven Compiler Plugin
> Issue Type: Bug
> Affects Versions: 3.7.0
> Environment: Apache Maven 3.0.5 (r01de14724cdef164cd33c7c8c2fe155faf9602da; 2013-02-19 14:51:28+0100)
> Maven home: T:\apache-maven\apache-maven-3.0.5
> Java version: 1.6.0_141, vendor: Sun Microsystems Inc.
> Java home: C:\opt\Java\jdk1.6.0_141\jre
> Default locale: en_US, platform encoding: Cp1252
> OS name: "windows 7", version: "6.1", arch: "x86", family: "windows"
> Reporter: Benoît Berthonneau
> Assignee: Robert Scholte
> Priority: Critical
>
> With Maven projects using Java 1.6, the Maven Compiler plugin is not usable. The following error is raised :
> {code:java}
> [WARNING] Error injecting: org.apache.maven.plugin.compiler.CompilerMojo
> java.lang.TypeNotPresentException: Type org.apache.maven.plugin.compiler.CompilerMojo not present
> at org.eclipse.sisu.space.URLClassSpace.loadClass(URLClassSpace.java:115)
> at org.eclipse.sisu.space.NamedClass.load(NamedClass.java:46)
> at org.eclipse.sisu.space.AbstractDeferredClass.get(AbstractDeferredClass.java:48)
> at com.google.inject.internal.ProviderInternalFactory.provision(ProviderInternalFactory.java:86)
> at com.google.inject.internal.InternalFactoryToInitializableAdapter.provision(InternalFactoryToInitializableAdapter.java:55)
> at com.google.inject.internal.ProviderInternalFactory$1.call(ProviderInternalFactory.java:70)
> at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision(ProvisionListenerStackCallback.java:100)
> at org.eclipse.sisu.plexus.PlexusLifecycleManager.onProvision(PlexusLifecycleManager.java:133)
> at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision(ProvisionListenerStackCallback.java:109)
> at com.google.inject.internal.ProvisionListenerStackCallback.provision(ProvisionListenerStackCallback.java:55)
> at com.google.inject.internal.ProviderInternalFactory.circularGet(ProviderInternalFactory.java:68)
> at com.google.inject.internal.InternalFactoryToInitializableAdapter.get(InternalFactoryToInitializableAdapter.java:47)
> at com.google.inject.internal.InjectorImpl$2$1.call(InjectorImpl.java:997)
> at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1047)
> at com.google.inject.internal.InjectorImpl$2.get(InjectorImpl.java:993)
> at com.google.inject.Scopes$1$1.get(Scopes.java:59)
> at org.eclipse.sisu.inject.LazyBeanEntry.getValue(LazyBeanEntry.java:82)
> at org.eclipse.sisu.plexus.LazyPlexusBean.getValue(LazyPlexusBean.java:51)
> at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:260)
> at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:252)
> at org.apache.maven.plugin.internal.DefaultMavenPluginManager.getConfiguredMojo(DefaultMavenPluginManager.java:459)
> at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:97)
> at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
> at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
> at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
> at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
> at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
> at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
> at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
> at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:317)
> at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:152)
> at org.apache.maven.cli.MavenCli.execute(MavenCli.java:555)
> at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:214)
> at org.apache.maven.cli.MavenCli.main(MavenCli.java:158)
> 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.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
> at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
> at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
> at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
> Caused by: java.lang.UnsupportedClassVersionError: org/apache/maven/plugin/compiler/CompilerMojo : Unsupported major.minor version 51.0
> at java.lang.ClassLoader.defineClass1(Native Method)
> at java.lang.ClassLoader.defineClassCond(Unknown Source)
> 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.access$000(Unknown Source)
> at java.net.URLClassLoader$1.run(Unknown Source)
> at java.security.AccessController.doPrivileged(Native Method)
> at java.net.URLClassLoader.findClass(Unknown Source)
> at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClassFromSelf(ClassRealm.java:389)
> at org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass(SelfFirstStrategy.java:42)
> at org.codehaus.plexus.classworlds.realm.ClassRealm.unsynchronizedLoadClass(ClassRealm.java:259)
> at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:242)
> at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:227)
> at org.eclipse.sisu.space.URLClassSpace.loadClass(URLClassSpace.java:107)
> ... 41 more
> [INFO] ------------------------------------------------------------------------
> [INFO] BUILD FAILURE
> [INFO] ------------------------------------------------------------------------
> [INFO] Total time: 14.976s
> [INFO] Finished at: Fri Dec 15 11:28:25 CET 2017
> [INFO] Final Memory: 6M/16M
> [INFO] ------------------------------------------------------------------------
> [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.7.0:compile (default-compile) on project gc-log-parser: Execution default-compile of goal org.apache.maven.plugins:maven-compiler-plugin:3.7.0:compile failed: Unable to load the mojo 'compile' in the plugin 'org.apache.m
> aven.plugins:maven-compiler-plugin:3.7.0' due to an API incompatibility: org.codehaus.plexus.component.repository.exception.ComponentLookupException: org/apache/maven/plugin/compiler/CompilerMojo : Unsupported major.minor version 51.0
> [ERROR] -----------------------------------------------------
> {code}
> This restriction is not documented on the website. How could we use the plugin in this kind of environment ?
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)