致命错误:java.lang的无效布局。字符串值

时间:2022-11-07 22:33:40

I got an extremely annyoing error in Eclipse (in the console):

我在Eclipse中(在控制台中)有一个非常严重的错误:

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=15238, tid=140306591237888
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 ops)
 Failed to write core dump. Core dumps have been disabled. To enable core dumping, try ulimit -c unlimited" before starting Java again

 An error report file with more information is saved as:
 /home/till/workspace/Encrypt/hs_err_pid15238.log

 If you would like to submit a bug report, please visit:
   http://bugreport.sun.com/bugreport/crash.jsp

Log Download

日志下载

I cant't make any sense of this, because even Eclipse doesn't display any errors (in the code editor)... This is a real productivity-killer, because it blocks all progress. If anyone has any ideas on how to solve this, please answer this question.

我无法理解这一点,因为即使是Eclipse也不会显示任何错误(在代码编辑器中)……这是一个真正的生产力杀手,因为它阻碍了所有的进步。如果有人对如何解决这个问题有什么想法,请回答这个问题。

Thank you really much in advance,

非常感谢大家,

Till

直到

7 个解决方案

#1


66  

I had same problem,then(as Jeff Schultz said here) I tried:

我遇到了同样的问题(正如杰夫·舒尔茨在这里所说):

Run As -> Android Application

运行为-> Android应用程序

and problem solved.But I don't know the reason that causes this problem.I hope this help you!

和问题解决。但是我不知道这个问题的原因。我希望这能帮助你!

#2


118  

In case of an Android project, you have to remove Android Lib from the launch configuration for that specific class. Use the "walkthrough" below as a guide.

对于Android项目,您必须从特定类的启动配置中删除Android Lib。使用下面的“演练”作为指南。

  • Project->Properties->Run/Debug Settings;
  • 项目- >属性- >运行/调试设置;
  • Select your Class and click "Edit";
  • 选择您的类并单击“编辑”;
  • Open the tab "Classpath" and remove Android Lib from "Bootstrap Entries";
  • 打开“Classpath”选项卡,从“引导条目”中删除Android Lib;
  • Apply everything and Run the class again.
  • 应用所有内容并再次运行类。

#3


4  

This happened to me after:

这发生在我之后:

  1. Inserting a class in the Android Application project where I had forgotten to remove public static void main(String args[]) function. (Had previously performed a quick test of the class).
  2. 在Android应用程序项目中插入一个类,我忘记删除公共静态void main(String args[])函数。(先前对这个类进行了快速测试)。
  3. Tried to run the Application while I had opened and focused the above class on Eclipse editor.
  4. 当我打开并将上面的类集中在Eclipse编辑器上时,尝试运行应用程序。

The funny thing was that, after the Eclipse error, no matter on what class I switched the focus on, when I was trying to run the application again, I was stuck with the same error.

有趣的是,在Eclipse错误发生之后,无论我将焦点转移到什么类上,当我再次尝试运行应用程序时,我都遇到了同样的错误。

Inspired by Odyr Sohn solution, I managed to solve the problem (from Project->Properties->Run/Debug Settings deleting the faulty Launch configuration), but as soon as I was trying to run the application from this class, the same thing was happening again. When I removed public static void main(String args[]) function from the class, the problem was solved for good.

在Odyr Sohn解决方案的启发下,我设法解决了这个问题(从Project->属性->运行/调试设置删除了错误的启动配置),但是当我试图从这个类运行应用程序时,同样的事情又发生了。当我从类中移除公共静态void main(String args[])函数时,这个问题得到了很好的解决。

#4


1  

You should make a run configuration for an "Android application". If you make it for "Java Application" by mistake this error will show.

您应该为“Android应用程序”进行运行配置。如果您错误地将它用于“Java应用程序”,则将显示此错误。

#5


0  

Same thing happened to me. I created a TestActivity and I guess it had a public static void main(String args[]) function. I went into the properties and then the Run/Debug and deleted TestActivity and it worked just fine.

同样的事情也发生在我身上。我创建了一个TestActivity,我猜它有一个公共的静态void main(String args[])函数。我进入了属性,然后运行/调试和删除TestActivity,它运行得很好。

#6


0  

I had the same problem, solved it by:

我遇到了同样的问题,通过:

Run->Run Configurations;

运行- >运行配置;

Click on left on "Android Application"-> Button on top "New";

点击左边的“Android应用”->按钮顶部的“New”;

then type in a name and "Browse" the Project -> works!

然后输入一个名称并“浏览”项目——>工作!

#7


0  

I had a similar problem on the fatal error: Invalid layout of preloaded class with Kepler Service Release 1 using windows 7.

我在致命错误上遇到了一个类似的问题:使用windows 7的开普勒服务版本1的预装类的布局无效。

Project -> Properties -> Java Build Path -> Order and Export --> check mark any 
unchecked library or Android version and then hit OK. Then run as Android application.

#1


66  

I had same problem,then(as Jeff Schultz said here) I tried:

我遇到了同样的问题(正如杰夫·舒尔茨在这里所说):

Run As -> Android Application

运行为-> Android应用程序

and problem solved.But I don't know the reason that causes this problem.I hope this help you!

和问题解决。但是我不知道这个问题的原因。我希望这能帮助你!

#2


118  

In case of an Android project, you have to remove Android Lib from the launch configuration for that specific class. Use the "walkthrough" below as a guide.

对于Android项目,您必须从特定类的启动配置中删除Android Lib。使用下面的“演练”作为指南。

  • Project->Properties->Run/Debug Settings;
  • 项目- >属性- >运行/调试设置;
  • Select your Class and click "Edit";
  • 选择您的类并单击“编辑”;
  • Open the tab "Classpath" and remove Android Lib from "Bootstrap Entries";
  • 打开“Classpath”选项卡,从“引导条目”中删除Android Lib;
  • Apply everything and Run the class again.
  • 应用所有内容并再次运行类。

#3


4  

This happened to me after:

这发生在我之后:

  1. Inserting a class in the Android Application project where I had forgotten to remove public static void main(String args[]) function. (Had previously performed a quick test of the class).
  2. 在Android应用程序项目中插入一个类,我忘记删除公共静态void main(String args[])函数。(先前对这个类进行了快速测试)。
  3. Tried to run the Application while I had opened and focused the above class on Eclipse editor.
  4. 当我打开并将上面的类集中在Eclipse编辑器上时,尝试运行应用程序。

The funny thing was that, after the Eclipse error, no matter on what class I switched the focus on, when I was trying to run the application again, I was stuck with the same error.

有趣的是,在Eclipse错误发生之后,无论我将焦点转移到什么类上,当我再次尝试运行应用程序时,我都遇到了同样的错误。

Inspired by Odyr Sohn solution, I managed to solve the problem (from Project->Properties->Run/Debug Settings deleting the faulty Launch configuration), but as soon as I was trying to run the application from this class, the same thing was happening again. When I removed public static void main(String args[]) function from the class, the problem was solved for good.

在Odyr Sohn解决方案的启发下,我设法解决了这个问题(从Project->属性->运行/调试设置删除了错误的启动配置),但是当我试图从这个类运行应用程序时,同样的事情又发生了。当我从类中移除公共静态void main(String args[])函数时,这个问题得到了很好的解决。

#4


1  

You should make a run configuration for an "Android application". If you make it for "Java Application" by mistake this error will show.

您应该为“Android应用程序”进行运行配置。如果您错误地将它用于“Java应用程序”,则将显示此错误。

#5


0  

Same thing happened to me. I created a TestActivity and I guess it had a public static void main(String args[]) function. I went into the properties and then the Run/Debug and deleted TestActivity and it worked just fine.

同样的事情也发生在我身上。我创建了一个TestActivity,我猜它有一个公共的静态void main(String args[])函数。我进入了属性,然后运行/调试和删除TestActivity,它运行得很好。

#6


0  

I had the same problem, solved it by:

我遇到了同样的问题,通过:

Run->Run Configurations;

运行- >运行配置;

Click on left on "Android Application"-> Button on top "New";

点击左边的“Android应用”->按钮顶部的“New”;

then type in a name and "Browse" the Project -> works!

然后输入一个名称并“浏览”项目——>工作!

#7


0  

I had a similar problem on the fatal error: Invalid layout of preloaded class with Kepler Service Release 1 using windows 7.

我在致命错误上遇到了一个类似的问题:使用windows 7的开普勒服务版本1的预装类的布局无效。

Project -> Properties -> Java Build Path -> Order and Export --> check mark any 
unchecked library or Android version and then hit OK. Then run as Android application.