A fatal error has been detected by the Java Runtime Environment:
今天写一个Android调用天气预报的webservice demo的时候,在main里测试发现这么一个错误:
#
# A fatal error has been detected by the Java Runtime Environment:
#
# Internal Error (classFileParser.cpp:3494), pid=9988, tid=5220
# Error: ShouldNotReachHere()
#
# JRE version: 6.0_45-b06
# Java VM: Java HotSpot(TM) 64-Bit Server VM (20.45-b01 mixed mode windows-amd64 compressed oops)
# If you would like to submit a bug report, please visit:
# http://java.sun.com/webapps/bugreport/crash.jsp
#
# # A fatal error has been detected by the Java Runtime Environment: # # Internal Error (classFileParser.cpp:3494), pid=440, tid=744 # Error: ShouldNotReachHere() # # JRE version: 6.0_45-b06 # Java VM: Java HotSpot(TM) Client VM (20.45-b01 mixed mode windows-x86 ) # An error report file with more information is saved as: # F:\VideoApp\AndroidClient\hs_err_pid440.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp
解决办法如下:
1.选中需要运行的Java类,右键 -> Run As -> Run Configurations...
2.切换到Classpath选项栏,删掉Bootstrap Entries里面的Android Library,然后点击右侧的Advanced.. -> Add Library -> JRE System Library,一路next即可。
----------------------
同时还发现,Internal Error (classFileParser.cpp:3494)错误在Junit测试时也会发生,进行junit测试时出现的具体错误如下:
# # A fatal error has been detected by the Java Runtime Environment: # # Internal Error (classFileParser.cpp:3494), pid=7480, tid=6876 # Error: ShouldNotReachHere() # # JRE version: 6.0_45-b06 # Java VM: Java HotSpot(TM) Client VM (20.45-b01 mixed mode windows-x86 ) # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp #
一般在升级了ADT之后,这个错误最容易出现。
解决办法:
1.选中junit测试类,右键 -> Run As -> Run Configurations...
2.切换到Classpath选项栏,删掉Bootstrap Entries里面的Android Library,然后点击右侧的Advanced.. -> Add Library -> JRE System Library,一路next即可。
--转自