Uploaded image for project: 'Maven Surefire'
  1. Maven Surefire
  2. SUREFIRE-1923

Toolchain using JDK 6 does not work

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 3.0.0-M5
    • Fix Version/s: None
    • Component/s: Maven Surefire Plugin
    • Labels:
      None

      Description

      Using toolchain in attempt to get a working build using Java 6, with Maven itself using Java 8. Shouldn't using the toolchain allow using older versions for compiling and execution of tests, since plugin itself is running with whatever Maven uses?

      Error I get is:

       

      Error:  Exception in thread "main" java.lang.UnsupportedClassVersionError: org/apache/maven/surefire/booter/ForkedBooter : Unsupported major.minor version 51.0
          Error:  	at java.lang.ClassLoader.defineClass1(Native Method)
          Error:  	at java.lang.ClassLoader.defineClass(ClassLoader.java:648)
          Error:  	at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
          Error:  	at java.net.URLClassLoader.defineClass(URLClassLoader.java:296)
          Error:  	at java.net.URLClassLoader.access$000(URLClassLoader.java:69)
          Error:  	at java.net.URLClassLoader$1.run(URLClassLoader.java:231)
          Error:  	at java.net.URLClassLoader$1.run(URLClassLoader.java:225)
          Error:  	at java.security.AccessController.doPrivileged(Native Method)
          Error:  	at java.net.URLClassLoader.findClass(URLClassLoader.java:224)
          Error:  	at java.lang.ClassLoader.loadClass(ClassLoader.java:325)
          Error:  	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:307)
          Error:  	at java.lang.ClassLoader.loadClass(ClassLoader.java:270)
          Error:  	at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:406)
      

      Attached my pom.

      Also this error can be seen:

      Error:  Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:3.0.0-M5:test (default-test) on project minimal-di: There are test failures.
          Error:  
          Error:  Please refer to /home/runner/work/minimal-di/minimal-di/target/surefire-reports for the individual test results.
          Error:  Please refer to dump files (if any exist) [date].dump, [date]-jvmRun[N].dump and [date].dumpstream.
          Error:  The forked VM terminated without properly saying goodbye. VM crash or System.exit called?
          Error:  Command was /bin/sh -c cd /home/runner/work/minimal-di/minimal-di && /home/runner/.jabba/jdk/zulu@1.6.119/bin/java -javaagent:/home/runner/.m2/repository/org/jacoco/org.jacoco.agent/0.8.7/org.jacoco.agent-0.8.7-runtime.jar=destfile=/home/runner/work/minimal-di/minimal-di/target/jacoco.exec -jar /home/runner/work/minimal-di/minimal-di/target/surefire/surefirebooter4248000144598324679.jar /home/runner/work/minimal-di/minimal-di/target/surefire 2021-06-28T18-08-47_748-jvmRun1 surefire5952048774464180572tmp surefire_03168907528824382024tmp
          Error:  Error occurred in starting fork, check output in log
          Error:  Process Exit Code: 1
          Error:  org.apache.maven.surefire.booter.SurefireBooterForkException: The forked VM terminated without properly saying goodbye. VM crash or System.exit called?
          Error:  Command was /bin/sh -c cd /home/runner/work/minimal-di/minimal-di && /home/runner/.jabba/jdk/zulu@1.6.119/bin/java -javaagent:/home/runner/.m2/repository/org/jacoco/org.jacoco.agent/0.8.7/org.jacoco.agent-0.8.7-runtime.jar=destfile=/home/runner/work/minimal-di/minimal-di/target/jacoco.exec -jar /home/runner/work/minimal-di/minimal-di/target/surefire/surefirebooter4248000144598324679.jar /home/runner/work/minimal-di/minimal-di/target/surefire 2021-06-28T18-08-47_748-jvmRun1 surefire5952048774464180572tmp surefire_03168907528824382024tmp
          Error:  Error occurred in starting fork, check output in log
          Error:  Process Exit Code: 1
          Error:  	at org.apache.maven.plugin.surefire.booterclient.ForkStarter.fork(ForkStarter.java:748)
          Error:  	at org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:305)
          Error:  	at org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:265)
          Error:  	at org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeProvider(AbstractSurefireMojo.java:1314)
          Error:  	at org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeAfterPreconditionsChecked(AbstractSurefireMojo.java:1159)
          Error:  	at org.apache.maven.plugin.surefire.AbstractSurefireMojo.execute(AbstractSurefireMojo.java:932)
          Error:  	at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:137)
          Error:  	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:210)
          Error:  	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:156)
          Error:  	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:148)
          Error:  	at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:117)
          Error:  	at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:81)
          Error:  	at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:56)
          Error:  	at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
          Error:  	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:305)
          Error:  	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:192)
          Error:  	at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:105)
          Error:  	at org.apache.maven.cli.MavenCli.execute(MavenCli.java:957)
          Error:  	at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:289)
          Error:  	at org.apache.maven.cli.MavenCli.main(MavenCli.java:193)
          Error:  	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          Error:  	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
          Error:  	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
          Error:  	at java.lang.reflect.Method.invoke(Method.java:498)
          Error:  	at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:282)
          Error:  	at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:225)
          Error:  	at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:406)
          Error:  	at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:347)
          Error:  -> [Help 1]
      
      

        Attachments

        1. pom.xml
          13 kB
          Jarkko Rantavuori

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              jarkkor Jarkko Rantavuori
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated: