启动eclipse时出现java.lang.ClassNotFoundException

时间:2012-05-24 18:35:08

标签: java eclipse exception reinstall

用dpkg(Ubuntu)清除并重新安装eclipse之后会出现错误:

cat     /home/sergiy/.eclipse/org.eclipse.platform_3.7.0_155965261/configuration/1337883707989.log
!SESSION Thu May 24 21:21:48 EEST 2012 -----------------------------------------
!ENTRY org.eclipse.equinox.launcher 4 0 2012-05-24 21:21:48.242
!MESSAGE Exception launching the Eclipse Platform:
!STACK
java.lang.ClassNotFoundException: org.eclipse.core.runtime.adaptor.EclipseStarter
    at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:321)
            at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
    at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:619)
    at org.eclipse.equinox.launcher.Main.basicRun(Main.java:577)
    at org.eclipse.equinox.launcher.Main.run(Main.java:1410)

这是/usr/lib/eclipse/configuration/config.ini文件:

#This configuration file was written by:     org.eclipse.equinox.internal.frameworkadmin.equinox.EquinoxFwConfigFileParser
#Wed Apr 04 13:29:31 UTC 2012
org.eclipse.update.reconcile=false
eclipse.p2.profile=PlatformProfile
osgi.instance.area.default=@user.home/workspace
osgi.framework=file\:plugins/org.eclipse.osgi_3.7.2.dist.jar
equinox.use.ds=true
eclipse.buildId=I20110613-1736
osgi.bundles=reference\:file\:org.eclipse.equinox.simpleconfigurator_1.0.200.dist.jar@1\:start
org.eclipse.equinox.simpleconfigurator.configUrl=file\:org.eclipse.equinox.simpleconfigurator/bundles.info
eclipse.product=org.eclipse.platform.ide
osgi.splashPath=platform\:/base/plugins/org.eclipse.platform
osgi.framework.extensions=
osgi.bundles.defaultStartLevel=4
eclipse.p2.data.area=@config.dir/../p2/
eclipse.application=org.eclipse.ui.ide.workbench
osgi.bundlefile.limit=100

如何解决此问题?提前谢谢!

2 个答案:

答案 0 :(得分:5)

第一个建议是 NOT 从任何Linux软件包管理器或软件存储库安装Eclipse。相反,只需从http://www.eclipse.org/downloads/获取它。 Linux发行版安装的版本经常被修改(有些人会说是错误的。)

答案 1 :(得分:0)

请参阅https://askubuntu.com/a/695401/407641以获取完整说明,...

<强>亮点

  • 不要sudo apt-get eclipse,该版本
  • http://www.eclipse.org/downloads
  • 下载并安装
  • 创建~/Desktop/eclipse.desktop文件。请注意,Desktop文件夹的完整路径将取决于您的ubuntu版本。