Internal Error (classFileParser.cpp:3161), pid=3412, tid=140710895388416 Error: ShouldNotReachHer

练习写android程序时,想做一个java测试,就在android项目中写了个代main主方法的类,运行的时候出现了如下错误:

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  Internal Error (classFileParser.cpp:3161), pid=3412, tid=140710895388416
#  Error: ShouldNotReachHere()
#
# JRE version: 6.0_22-b04
# Java VM: Java HotSpot(TM) 64-Bit Server VM (17.1-b03 mixed mode linux-amd64 )
# An error report file with more information is saved as:
# /home/malong/Work/workTool/androidspace/workspace/DemoTest/hs_err_pid3412.log
#
# If you would like to submit a bug report, please visit:
#   http://java.sun.com/webapps/bugreport/crash.jsp
#


搜索研究发现,main方法不能在android项目中直接引用anroid的jre运行,会和activity入口发生冲突。

解决方法

方法一:分开项目写,把main的类单建个java项目;

方法二:

1.右键run configurations-->Classpath

2.将Android4.2.2 Remove掉

3.添加自己的jre


你可能感兴趣的:(java,类,android)