Eclipse Eclipse项目内部如何使用main(String [] args)作为Java Application运行Java类?
public class JavaApp {
public static void main(String[] args) {
// some dummy operations here, possibly including
// System.out.print(string);
}
}
我收到错误
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=6748, tid=6676
# fatal error: Invalid layout of preloaded class
#
# JRE version: 7.0_11-b21
# Java VM: Java HotSpot(TM) 64-Bit Server VM (23.6-b04 mixed mode windows-amd64 compressed oops)
# Failed to write core dump. Minidumps are not enabled by default on client versions of Windows
#
# An error report file with more information is saved as:
# D:\Workspaces\ADT-Bundle\FMonPianoApp\hs_err_pid6748.log
#
# If you would like to submit a bug report, please visit:
# http://bugreport.sun.com/bugreport/crash.jsp
#
我使用main()
进行小型测试(没有JUnit)
答案 0 :(得分:22)
如果是 Android 项目,则必须从该特定类的启动配置中删除 Android Lib 。使用下面的“演练”作为指南。
或强>
您可以使用Run As -> Android Application
来解决此问题。可能会检查运行配置是否存在其他问题。
希望这有帮助