每次打开main.xml时,Eclipse上的Android都会崩溃

我将ADT加载到经典 Eclipse上.我按照 Android Helloworld入门指南中的步骤进行操作: http://developer.android.com/resources/tutorials/hello-world.html

每次加载main.xml时都会出现问题.它似乎是ADT插件的一个问题,因为它与它具有的GUI布局编辑器(在后台创建XML)有关.如果我直接访问XML源,它不会崩溃.

我收到了不同的错误消息,内存不足,没有退出信息,以及“checkandloadtargetdata permgen space中的异常”.如果您对我的设置有任何疑问,请随时在评论中发布,我会更新帖子.

我正在运行Windows 7 x64位,安装相当干净.我也有JDK 1.6.以下是位于.metadata中的Eclipse .log文件中的文本.任何帮助,将不胜感激.

!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

尝试下面的eclipse.ini设置后

-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

我现在得到一些新的东西,因为如果我一直打开Eclipse,那么main.xml已经“打开”了,只是让它流失了几秒而没有做任何事情,GUI编辑器出现了,似乎工作正常.如果我点击其他任何内容(如HelloAndroid.java的选项卡),它会锁定并崩溃.

我认为你需要增加PermGen的大小.有一篇关于 Eclipse Wiki的文章.1024m就足够了.
无论如何,我的eclipse.ini也应该有所帮助.

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
相关文章
相关标签/搜索