Android on Eclipse crashes every time I open main.xml

I have ADT loaded in classic Eclipse. I followed the steps from the Android Helloworld tutorial located here: http://developer.android.com/resources/tutorials/hello-world.html

The problem occurs every time I load main.xml. This is apparently a problem with the ADT plugin, as it refers to the GUI layout editor that it has (one that creates XML in the background). If I access the XML source directly, it does not crash.

I got various error messages, from memory, exit information and "exception in checkandloadtargetdata permgen space". If you have any questions about my setup, feel free to post them in the comments and I am updating the stream.

I am running Windows 7 x64 bit with a fairly clean installation. I also have JDK 1.6. Here is the text from the Eclipse.log file located in .metadata. Any help would be appreciated.

!SESSION 2011-08-14 13:11:38.628 ----------------------------------------------- eclipse.buildId=I20110613-1736 java.version=1.6.0_26 java.vendor=Sun Microsystems Inc. BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US Command-line arguments: -os win32 -ws win32 -arch x86_64 -debug -console -consoleLog !ENTRY org.eclipse.ui 4 0 2011-08-14 13:11:51.038 !MESSAGE Unhandled event loop exception !STACK 0 java.lang.OutOfMemoryError: PermGen space at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClassCond(Unknown Source) at java.lang.ClassLoader.defineClass(Unknown Source) at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.defineClass(DefaultClassLoader.java:188) at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.defineClass(ClasspathManager.java:601) at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findClassImpl(ClasspathManager.java:567) at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClassImpl(ClasspathManager.java:490) at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClass_LockClassLoader(ClasspathManager.java:478) at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClass(ClasspathManager.java:458) at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.findLocalClass(DefaultClassLoader.java:216) at org.eclipse.osgi.internal.loader.BundleLoader.findLocalClass(BundleLoader.java:400) at org.eclipse.osgi.internal.loader.SingleSourcePackage.loadClass(SingleSourcePackage.java:35) at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:473) at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:429) at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:417) at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107) at java.lang.ClassLoader.loadClass(Unknown Source) at java.lang.Class.getDeclaredConstructors0(Native Method) at java.lang.Class.privateGetDeclaredConstructors(Unknown Source) at java.lang.Class.getConstructor0(Unknown Source) at java.lang.Class.newInstance0(Unknown Source) at java.lang.Class.newInstance(Unknown Source) at org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.createExecutableExtension(RegistryStrategyOSGI.java:184) at org.eclipse.core.internal.registry.ExtensionRegistry.createExecutableExtension(ExtensionRegistry.java:905) at org.eclipse.core.internal.registry.ConfigurationElement.createExecutableExtension(ConfigurationElement.java:243) at org.eclipse.core.internal.registry.ConfigurationElementHandle.createExecutableExtension(ConfigurationElementHandle.java:55) at org.eclipse.ui.internal.WorkbenchPlugin.createExtension(WorkbenchPlugin.java:260) at org.eclipse.ui.internal.registry.ViewDescriptor.createView(ViewDescriptor.java:63) at org.eclipse.ui.internal.ViewReference.createPartHelper(ViewReference.java:327) at org.eclipse.ui.internal.ViewReference.createPart(ViewReference.java:229) at org.eclipse.ui.internal.WorkbenchPartReference.getPart(WorkbenchPartReference.java:595) at org.eclipse.ui.internal.ViewReference.getView(ViewReference.java:198) !ENTRY com.android.ide.eclipse.adt 4 0 2011-08-14 13:11:51.043 !MESSAGE Exception in checkAndLoadTargetData. !STACK 0 java.lang.OutOfMemoryError: PermGen space !ENTRY org.eclipse.ui 4 0 2011-08-14 13:11:51.056 !MESSAGE Error occurred during status handling !STACK 0 java.lang.OutOfMemoryError: PermGen space at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClassCond(Unknown Source) at java.lang.ClassLoader.defineClass(Unknown Source) at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.defineClass(DefaultClassLoader.java:188) at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.defineClass(ClasspathManager.java:601) at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findClassImpl(ClasspathManager.java:567) at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClassImpl(ClasspathManager.java:490) at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClass_LockClassLoader(ClasspathManager.java:478) at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClass(ClasspathManager.java:458) at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.findLocalClass(DefaultClassLoader.java:216) at org.eclipse.osgi.internal.loader.BundleLoader.findLocalClass(BundleLoader.java:400) at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:476) at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:429) at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:417) at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107) at java.lang.ClassLoader.loadClass(Unknown Source) at org.eclipse.ui.statushandlers.StatusManager.getStatusHandler(StatusManager.java:135) at org.eclipse.ui.statushandlers.StatusManager.handle(StatusManager.java:189) at org.eclipse.ui.statushandlers.StatusManager.handle(StatusManager.java:231) at org.eclipse.ui.statushandlers.StatusManager.handle(StatusManager.java:242) at org.eclipse.ui.application.WorkbenchAdvisor.eventLoopException(WorkbenchAdvisor.java:326) at org.eclipse.ui.internal.ExceptionHandler.handleException(ExceptionHandler.java:65) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2700) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2660) at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2494) at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:674) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:667) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149) at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:123) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110) !ENTRY org.eclipse.ui 4 4 2011-08-14 13:13:59.256 !MESSAGE Invalid preference page path: XML Syntax !ENTRY com.android.ide.eclipse.adt 4 0 2011-08-14 13:13:59.263 !MESSAGE Parsing Data for android-7 failed !STACK 0 java.lang.OutOfMemoryError: PermGen space 

Try the eclipse.ini settings below

 -startup plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar --launcher.library plugins/org.eclipse.equinox.launcher.win32.win32.x86_64_1.1.100.v20110502 -showsplash org.eclipse.platform --launcher.defaultAction openFile -vmargs -Xms2048m -Xmx2048m -XX:PermSize=1024m -XX:MaxPermSize=1024m -XX:+UseParallelGC 

Now I get something new, since main.xml is already β€œopen”, if I fully open Eclipse and just let it lean back for a few seconds without doing anything, the GUI editor appears and seems to work fine. If I click on something else (like on the HelloAndroid.java tab), it will close and work.

+6
source share
4 answers

I uninstalled the SDK, uninstalled the Eclipse installation, and reinstalled everything.

Famous things that I changed.

-I moved the installation of Eclipse from the program files directory, since I know that Windows treats this differently. Now it is in C: / Eclipse

- I moved the Android SDK from the program file directory for the same reasons and made sure that there were no spaces in the path. Now it is in C: / androidSDK /

It seems to be working fine now. I wonder if there was a conflict between eclipse in one of the program file files and the SDK in another. I don’t know if windows will load these programs differently based on which directory they are in. In any case, if you have such a problem, move them from the program file directory.

0
source

I think you need to increase the size of PermGen. There is an article on the Eclipse Wiki . 1024m will be enough.
Anyway, my eclipse.ini should help too.

 cat /opt/eclipse/eclipse.ini -startup plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar --launcher.library plugins/org.eclipse.equinox.launcher.gtk.linux.x86_64_1.1.100.v20110505 -showsplash org.eclipse.platform --launcher.defaultAction openFile -vmargs -Xms2048m -Xmx2048m -XX:PermSize=1024m -XX:MaxPermSize=1024m -XX:+UseParallelGC 
+4
source

You need to upgrade jdk version to latest version. I found that most cases on the Internet are that jdk5 slowed down eclipse, and they were developed by upgrading to jdk6. I used jdk6, but the problem existed! Finally, I download the latest version (jdk7) and eclipse will no longer work!

+4
source

Attempted responses in this post. This worked for me on Windows 7 x64 bit and JDK 1.7 - remove the nasty Eclipse (Mars Java + ADT) and reinstall. I have not made changes to PermSize, but I have -Xms512m -Xmx1024m in the eclipse.ini file. The original workspace also loaded.

0
source

Source: https://habr.com/ru/post/895024/


All Articles