我正在尝试在 Eclipse 上使用 JUnit 4 和 Robolectric 运行测试,但我一直收到此错误:
Invalid layout of java.lang.String at value
#
# A fatal error has been detected by the Java Runtime Environment:
#
# Internal Error (javaClasses.cpp:129), pid=3546, tid=140317899335424
# fatal error: Invalid layout of preloaded class
#
# JRE version: 7.0_07-b10
# Java VM: Java HotSpot(TM) 64-Bit Server VM (23.3-b01 mixed mode linux-amd64 compressed oops)
# Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
#
我的测试很简单。它仅用于检查所有工作:
@RunWith(RobolectricTestRunner.class)
public class FormatTest {
@Test
public void getFormatElapsedTimeOnSecondsTest(){
assertEquals("3seg","3seg");
}
}
我的系统上安装的 Java 是:
java version "1.7.0_07"
Java(TM) SE Runtime Environment (build 1.7.0_07-b10)
Java HotSpot(TM) 64-Bit Server VM (build 23.3-b01, mixed mode)
我不明白发生了什么。