eclipse安装JD-Eclipse后,打开自动关闭解决办法

时间:2022-11-05 23:55:18
 最近在开发的android项目中安装了一个插件JD-Eclipse,用于反编译android项目,安装成功后,重启eclipse,打开主界面,过几秒后eclipse自动关闭。再重启,还是这样。
查看错误日志,显示如下:
!ENTRY org.eclipse.osgi 2 0 2011-02-27 13:44:07.375
!MESSAGE While loading class "com.android.ide.eclipse.adt.internal.sdk.Sdk", thread "Thread[Worker-2,5,main]" timed out waiting (5000ms) for thread "Thread[org.eclipse.jdt.internal.ui.text.JavaReconciler,1,main]" to finish starting bundle "com.android.ide.eclipse.adt_0.9.9.v201009221407-60953 [744]". To avoid deadlock, thread "Thread[Worker-2,5,main]" is proceeding but "com.android.ide.eclipse.adt.internal.sdk.Sdk" may not be fully initialized.
!STACK 0
org.osgi.framework.BundleException: State change in progress for bundle "reference:file:plugins/com.android.ide.eclipse.adt_0.9.9.v201009221407-60953.jar" by thread "org.eclipse.jdt.internal.ui.text.JavaReconciler".
at org.eclipse.osgi.framework.internal.core.AbstractBundle.beginStateChange(AbstractBundle.java:1077)
at org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:282)
at org.eclipse.osgi.framework.util.SecureAction.start(SecureAction.java:417)
at org.eclipse.osgi.internal.loader.BundleLoader.setLazyTrigger(BundleLoader.java:265)
at org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:106)
at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClass(ClasspathManager.java:453)
at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.findLocalClass(DefaultClassLoader.java:216)
at org.eclipse.osgi.internal.loader.BundleLoader.findLocalClass(BundleLoader.java:393)
at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:469)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:422)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:410)
at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
at com.android.ide.eclipse.adt.internal.project.AndroidClasspathContainerInitializer.allocateAndroidContainer(Unknown Source)
at com.android.ide.eclipse.adt.internal.project.AndroidClasspathContainerInitializer.initialize(Unknown Source)
at org.eclipse.jdt.internal.core.JavaModelManager.initializeContainer(JavaModelManager.java:2707)
at org.eclipse.jdt.internal.core.JavaModelManager$11.run(JavaModelManager.java:2613)
at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1975)
at org.eclipse.jdt.internal.core.JavaModelManager.initializeAllContainers(JavaModelManager.java:2653)
at org.eclipse.jdt.internal.core.JavaModelManager.getClasspathContainer(JavaModelManager.java:1845)
at org.eclipse.jdt.core.JavaCore.initializeAfterLoad(JavaCore.java:3463)
at org.eclipse.jdt.internal.ui.InitializeAfterLoadJob$RealJob.run(InitializeAfterLoadJob.java:35)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
Caused by: org.eclipse.osgi.framework.internal.core.AbstractBundle$BundleStatusException
... 24 more

Root exception:
org.eclipse.osgi.framework.internal.core.AbstractBundle$BundleStatusException
at org.eclipse.osgi.framework.internal.core.AbstractBundle.beginStateChange(AbstractBundle.java:1077)
at org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:282)
at org.eclipse.osgi.framework.util.SecureAction.start(SecureAction.java:417)
at org.eclipse.osgi.internal.loader.BundleLoader.setLazyTrigger(BundleLoader.java:265)
at org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:106)
at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClass(ClasspathManager.java:453)
at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.findLocalClass(DefaultClassLoader.java:216)
at org.eclipse.osgi.internal.loader.BundleLoader.findLocalClass(BundleLoader.java:393)
at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:469)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:422)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:410)
at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
at com.android.ide.eclipse.adt.internal.project.AndroidClasspathContainerInitializer.allocateAndroidContainer(Unknown Source)
at com.android.ide.eclipse.adt.internal.project.AndroidClasspathContainerInitializer.initialize(Unknown Source)
at org.eclipse.jdt.internal.core.JavaModelManager.initializeContainer(JavaModelManager.java:2707)
at org.eclipse.jdt.internal.core.JavaModelManager$11.run(JavaModelManager.java:2613)
at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1975)
at org.eclipse.jdt.internal.core.JavaModelManager.initializeAllContainers(JavaModelManager.java:2653)
at org.eclipse.jdt.internal.core.JavaModelManager.getClasspathContainer(JavaModelManager.java:1845)
at org.eclipse.jdt.core.JavaCore.initializeAfterLoad(JavaCore.java:3463)
at org.eclipse.jdt.internal.ui.InitializeAfterLoadJob$RealJob.run(InitializeAfterLoadJob.java:35)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)


找原因找了半天,原来纯碎是虚拟内存不足。修改eclipse的eclipse.init配置文件,增大虚拟内存。配置文件内容如下:
Java代码 eclipse安装JD-Eclipse后,打开自动关闭解决办法  eclipse安装JD-Eclipse后,打开自动关闭解决办法eclipse安装JD-Eclipse后,打开自动关闭解决办法
  1. -startup   
  2. plugins/org.eclipse.equinox.launcher_1.1.0.v20100507.jar   
  3. --launcher.library   
  4. plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.1.0.v20100503   
  5. -product   
  6. org.eclipse.epp.package.jee.product   
  7. --launcher.defaultAction   
  8. openFile   
  9. --launcher.XXMaxPermSize   
  10. 512M   
  11. -showsplash   
  12. org.eclipse.platform   
  13. --launcher.XXMaxPermSize   
  14. 512m   
  15. --launcher.defaultAction   
  16. openFile   
  17. -vmargs   
  18. -Dosgi.requiredJavaVersion=1.5  
  19. -Xms80m   
  20. -Xmx512m  

这下好了,再也不自动关闭了。