Eclipse crash after opening .xml file

4.2k Views Asked by At

i am starting with android development i have created some sample application but when i am opening .xml file resides in res/layout/main.xml after that my eclipse crash and close.

i even try "open with android layout editor" which also crashes eclipse.

i am not getting why this problem occur.

my os is ubantu 9.04 and using eclipse Galileo

EDIT:

i am getting following error in my eclipse log file. what dose this means???

!ENTRY com.android.ide.eclipse.adt 4 0 2011-04-29 16:56:16.476
!MESSAGE loadAndParseRClass failed to find class com.saltriver.gui.R
!STACK 0
java.lang.UnsupportedClassVersionError: Bad version number in .class file
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:465)
    at com.android.ide.eclipse.adt.internal.resources.manager.ProjectClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
    at com.android.ide.eclipse.adt.internal.resources.manager.CompiledResourcesMonitor.loadAndParseRClass(Unknown Source)
    at com.android.ide.eclipse.adt.internal.resources.manager.CompiledResourcesMonitor.fileChanged(Unknown Source)
    at com.android.ide.eclipse.adt.internal.resources.manager.GlobalProjectMonitor$DeltaVisitor.visit(Unknown Source)
    at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:68)
    at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:79)
    at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:79)
    at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:79)
    at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:79)
    at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:79)
    at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:79)
    at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:48)
    at com.android.ide.eclipse.adt.internal.resources.manager.GlobalProjectMonitor$1.resourceChanged(Unknown Source)
    at org.eclipse.core.internal.events.NotificationManager$2.run(NotificationManager.java:291)
    at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
    at org.eclipse.core.internal.events.NotificationManager.notify(NotificationManager.java:285)
    at org.eclipse.core.internal.events.NotificationManager.broadcastChanges(NotificationManager.java:149)
    at org.eclipse.core.internal.resources.Workspace.broadcastPostChange(Workspace.java:313)
    at org.eclipse.core.internal.resources.Workspace.endOperation(Workspace.java:1022)
    at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1809)
    at org.eclipse.core.internal.events.NotificationManager$NotifyJob.run(NotificationManager.java:40)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
2

There are 2 best solutions below

1
On BEST ANSWER

"crash" is not very specific. Look into the file .metadata/.log in your workspace to see if Eclipse wrote an error message before it died.

If that doesn't help, start Eclipse from a console with -debug -console -consoleLog.

[EDIT] The error means that you're using Java X to run Eclipse but a plugin needs Java Y (where Y > X).

the usual case is that you run Eclipse with Java 5 and you have a plugin which needs Java 6. Unfortunately, the error message is useless: It doesn't tell you which class is the problem, from which JAR it came, which version it has and which versions are supported - The code has all the information but some smart guy decided that you don't need that. Pity.

So try to get the latest version of Java to run the IDE.

This is independent of the Java version which you use to build and run your projects!! It's just the VM which Eclipse uses to load its plugins. For VMs used in projects, see the Eclipse preferences.

0
On

Close 'Eclipse'

Go to your Eclipse folder open eclipse.ini file in any text editor.

after the line which says openFile add following two lines.

-vm
C:\Program Files\Java\jdk1.6.0_24\bin\javaw.exe   

(This folder path may vary according to your java installation directory).

save and close.

Open eclipse and tadaaaa!!! you can open xml files again. :)