4

We are converting an existing app from Java 7 to Java 9 and I'm trying to follow this page here for the minimum requirements: https://cwiki.apache.org/confluence/display/MAVEN/Java+9+-+Jigsaw

When I try to run mvn clean install on a few of our components, I keep getting:

Caused by: org.apache.maven.surefire.booter.SurefireBooterForkException: The forked VM terminated without properly saying goodbye. VM crash or System.exit called?
Command was cmd.exe /X /C ""C:\Program Files\Java\jdk-9.0.1\bin\java" --add-modules java.se.ee -XX:-UseSplitVerifier -jar

When I try to google UseSplitVerifier, I keep seeing things about StackMapTable or if UseSplitVerifier is safe to be used. But I don't really know what UseSplitVerifier is and what is the correct approach to build from J7 -> J9.

Edit

My pom.xml has this plugin:

<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.20.1</version>

Looking at the https://cwiki.apache.org/confluence/display/MAVEN/Java+9+-+Jigsaw link it says minimum is to use 2.20.1 so I thought that would be ok? When I search my project, I don't see any UseSplitVerifier argument being passed so I'm not sure what is using that command except the surefire plugin.

halfer
  • 19,824
  • 17
  • 99
  • 186
Crystal
  • 28,460
  • 62
  • 219
  • 393
  • Just to add to the details, what maven-surefire-plugin version are you using in your project? Would be good to see compiler plugin configuration as well for the command in logs. Also note that you shouldn't use `-XX:-UseSplitVerifier` anymore. It has been deprecated since Java 8 and probably removed in Java9(*Unrecognized VM option 'UseSplitVerifier'*). – Naman Nov 03 '17 at 03:55
  • @nullpointer I'm not using that option when I run maven or in the pom. Is there another way this is getting run? – Crystal Nov 03 '17 at 15:25

1 Answers1

1

The probable cause for your failure logs to start off investigating is that the flag,

-XX:-UseSplitVerifier

which seems to have been deprecated with Java8 itself, is no more supported in Java9 [source - Complete list of JVM options

You should ideally get rid of this flag while migrating since you wouldn't be needing this while compiling or executing the classes to the version 53 of Java SE(Java9).


Edit: There was a memory leak reported in the 2.20.1 version of surefire while executing tests via junit. You might want to be still using 2.19.1 which should still work fine with Java9 modules.

Naman
  • 27,789
  • 26
  • 218
  • 353