1

即使您的代码编译为 java 1.6,您在 Java7 环境中运行时是否遇到过 emma 问题?

我有一个多模块构建,其中大多数为 jdk 1.7,为 GWT 模块及其依赖项使用 jdk 1.6(或者我认为 - 我怀疑我在这一点上弄错了,这是我问题的核心)。

Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.9:test 
(default-test) on project ...: Execution default-test of goal 
org.apache.maven.plugins:maven-surefire-plugin:2.9:test failed: java.lang.reflect.InvocationTargetException; nested exception is 
java.lang.reflect.InvocationTargetException: null: Illegal local variable 
table length 16 in method ....<init>()V -> [Help 1]

如果 GWT 和 emma 存在已知问题或解决方法,请告诉我。

谢谢

彼得

4

1 回答 1

0

问题似乎是依赖模块中的 java7 字节码不兼容。将支持 GWT 的基本模块的源和目标设置为 1.6 解决了这个问题。GWT 目前报告与 1.5 的兼容性,但 1.6 似乎可以正常工作。但是1.7是个问题。

    <plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-compiler-plugin</artifactId>
    ...
    <configuration>
      <source>1.6</source>
      <target>1.6</target>
    </configuration>
于 2012-08-13T19:36:41.833 回答