问题
I got an extremely annyoing error in Eclipse (in the console):
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.
Thank you really much in advance,
Till
回答1:
I had same problem,then(as Jeff Schultz said here) I tried:
Run As -> Android Application
and problem solved.But I don't know the reason that causes this problem.I hope this help you!
回答2:
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.
- Project->Properties->Run/Debug Settings;
- Select your Class and click "Edit";
- Open the tab "Classpath" and remove Android Lib from "Bootstrap Entries";
- Apply everything and Run the class again.
回答3:
This happened to me after:
- 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). - Tried to run the Application while I had opened and focused the above class on Eclipse editor.
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.
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.
回答4:
You should make a run configuration for an "Android application". If you make it for "Java Application" by mistake this error will show.
回答5:
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.
回答6:
I had the same problem, solved it by:
Run->Run Configurations;
Click on left on "Android Application"-> Button on top "New";
then type in a name and "Browse" the Project -> works!
回答7:
I had a similar problem on the fatal error: Invalid layout of preloaded class
with Kepler Service Release 1 using windows 7.
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.
来源:https://stackoverflow.com/questions/13030111/fatal-error-invalid-layout-of-java-lang-string-at-value