[ https://issues.apache.org/jira/browse/SUREFIRE-1820?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17160197#comment-17160197 ]
Robert Varga commented on SUREFIRE-1820: ---------------------------------------- Ah, sorry, --release takes a different argument than source/target: {noformat} nite@nitebug : ~/prj/maven-surefire on $ $JAVA_HOME/bin/javac --release 7 error: no source files {noformat} > Using SurefireForkNodeFactory with JDK8 results in NoSuchMethodError > -------------------------------------------------------------------- > > Key: SUREFIRE-1820 > URL: https://issues.apache.org/jira/browse/SUREFIRE-1820 > Project: Maven Surefire > Issue Type: Bug > Components: process forking > Affects Versions: 3.0.0-M5 > Reporter: Robert Varga > Priority: Major > > Attempting to use TCP channels for communication with JDK 1.8 results in the > following splat: > {noformat} > xception in thread "commands-fork-1" java.lang.NoSuchMethodError: > java.nio.ByteBuffer.position(I)Ljava/nio/ByteBuffer; > at > org.apache.maven.surefire.api.util.internal.AbstractNoninterruptibleWritableChannel.write(AbstractNoninterruptibleWritableChannel.java:76) > at > org.apache.maven.surefire.api.util.internal.AbstractNoninterruptibleWritableChannel.write(AbstractNoninterruptibleWritableChannel.java:44) > at > org.apache.maven.plugin.surefire.extensions.StreamFeeder.run(StreamFeeder.java:92) > Exception in thread "fork-1-event-thread" java.lang.NoSuchMethodError: > java.nio.ByteBuffer.position(I)Ljava/nio/ByteBuffer; > at > org.apache.maven.plugin.surefire.extensions.EventConsumerThread.decode(EventConsumerThread.java:140) > at > org.apache.maven.plugin.surefire.extensions.EventConsumerThread.run(EventConsumerThread.java:113) > Exception in thread "fork-1-err-thread" java.lang.NoSuchMethodError: > java.nio.ByteBuffer.position(I)Ljava/nio/ByteBuffer; > at > org.apache.maven.surefire.api.util.internal.Channels$3.readImpl(Channels.java:217) > at > org.apache.maven.surefire.api.util.internal.AbstractNoninterruptibleReadableChannel.read(AbstractNoninterruptibleReadableChannel.java:54) > at sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:274) > at sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:326) > at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:178) > at java.io.Reader.read(Reader.java:100) > at java.util.Scanner.readInput(Scanner.java:804) > at java.util.Scanner.findWithinHorizon(Scanner.java:1685) > at java.util.Scanner.hasNextLine(Scanner.java:1500) > at > org.apache.maven.surefire.extensions.util.LineConsumerThread.run(LineConsumerThread.java:67) > {noformat} > at least in the following configuration: > {noformat} > [ERROR] Failed to execute goal > org.apache.maven.plugins:maven-surefire-plugin:3.0.0-M5:test (default) on > project pt-triemap: There are test failures. > [ERROR] > [ERROR] Please refer to > /home/nite/pt/triemap/pt-triemap/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/nite/pt/triemap/pt-triemap && > /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.252.b09-1.fc32.x86_64/jre/bin/java -jar > /home/nite/pt/triemap/pt-triemap/target/surefire/surefirebooter5389144270021152085.jar > /home/nite/pt/triemap/pt-triemap/target/surefire > 2020-07-14T09-05-53_813-jvmRun1 surefire4432899852251024839tmp > surefire_06735691049687446297tmp{noformat} > Based on the discussion here: > [https://github.com/eclipse/jetty.project/issues/3244] , it would seem the > cause is that surefire release was compiled with JDK9+ without setting > --release to 8-or-lower. -- This message was sent by Atlassian Jira (v8.3.4#803005)