Java 8: What is the equivalent of “UseSplitVerifier”?

家住魔仙堡 提交于 2019-12-07 01:03:11

问题


I'm using Maven 3.2.3 on Mac 10.9.5 and have this for my compiler plugin ...

                                    <plugin>
                                            <groupId>org.apache.maven.plugins</groupId>
                                            <artifactId>maven-compiler-plugin</artifactId>
                                            <version>3.1</version>
                                            <configuration>
                                                    <source>1.8</source>
                                                    <target>1.8</target>
                                                    <compilerArgument>-proc:none</compilerArgument>
                                                    <fork>true</fork>
                                                    <!-- <compilerId>eclipse</compilerId>--> 
                                            </configuration>
                                            <executions>
                                                    <execution>
                                                            <id>default-testCompile</id>
                                                            <phase>test-compile</phase>
                                                            <goals>
                                                                    <goal>testCompile</goal>
                                                            </goals>
                                                    </execution>
                                            </executions>
                                    </plugin>

I have this for my surefire-plugin configuration ...

                    <plugin>
                            <groupId>org.apache.maven.plugins</groupId>
                            <artifactId>maven-surefire-plugin</artifactId>
                            <version>2.17</version>
                            <configuration>
                                    <reuseForks>true</reuseForks>
                                    <argLine>-Xmx2048m -XX:MaxPermSize=512M -XX:-UseSplitVerifier ${argLine}</argLine>
                                    <skipTests>${skipAllTests}</skipTests>
                            </configuration>
                    </plugin>

However, upon running "mvn clean install" I get this warning ...

Java HotSpot(TM) 64-Bit Server VM warning: ignoring option UseSplitVerifier; support was removed in 8.0

What is the Java 8 equivalent of "UseSplitVerifier"?


回答1:


There is no equivalent. Note that the option in your configuration is -UseSplitVerifier (note the prepended minus) so the option says not to use the SplitVerifier but starting with Java 8, the SplitVerifier is mandatory.

The SplitVerifier was introduced with Java 6, being optional at that time and became the default with Java 7. But with Java 7, the option was still supported, so it could get turned off in case a bytecode processing tool was incompatible.

This was meant to provide a grace period in which these tools can get updated to be compatible with the related StackMapFrame bytecode attribute. That grace period is now over.

If the only thing you encounter is that warning, in other words, you experience no compatibility problems, you can just remove that option. Otherwise, you have to update the problematic tools/libraries.




回答2:


You should stop using -XX:-UseSplitVerifier. Anyway, it's not supported by Java 8. And upgrade your maven-compiler-plugin to 3.2 . That will resolve your problems with bytecode verfication.



来源:https://stackoverflow.com/questions/31566672/java-8-what-is-the-equivalent-of-usesplitverifier

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!