Eclipse RCP java.lang.ClassNotFoundException: org.eclipse.core.runtime.adaptor.EclipseStarter

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/21129773/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-13 06:47:48  来源:igfitidea点击:

Eclipse RCP java.lang.ClassNotFoundException: org.eclipse.core.runtime.adaptor.EclipseStarter

javaeclipseeclipse-rcpeclipse-plugin

提问by Paul Verest

I use Eclipse 4.3.0 to develop plugins/RCP. While trying to do RCP product following Plug-in development 101, Part 2: Introducing rich-client applications http://www.ibm.com/developerworks/library/os-eclipse-plugindev2/by Chris Aniszczyk 2008, I got error below when clicking Launch an Eclipse applicationfrom .productOverview Tab.

我使用 Eclipse 4.3.0 来开发插件/RCP。在尝试按照插件开发 101,第 2 部分:引入富客户端应用程序http://www.ibm.com/developerworks/library/os-eclipse-plugindev2/by Chris Aniszczyk 2008 时,我在下面遇到错误Launch an Eclipse application.product概览选项卡中单击时。

!SESSION Wed Jan 15 13:06:51 CST 2014 ------------------------------------------
!ENTRY org.eclipse.equinox.launcher 4 0 2014-01-15 13:06:51.085
!MESSAGE Exception launching the Eclipse Platform:
!STACK
java.lang.ClassNotFoundException: org.eclipse.core.runtime.adaptor.EclipseStarter
    at java.net.URLClassLoader.run(URLClassLoader.java:366)
    at java.net.URLClassLoader.run(URLClassLoader.java:355)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:633)
    at org.eclipse.equinox.launcher.Main.basicRun(Main.java:591)
    at org.eclipse.equinox.launcher.Main.run(Main.java:1450)
    at org.eclipse.equinox.launcher.Main.main(Main.java:1426)

More info

更多信息

Notes: there were no rcp.productoption in Use existing product(I consider it was definite mistake in tutorial)

注意:没有rcp.product选项Use existing product(我认为这是教程中的明确错误)

plugin.xmlcontent

plugin.xml内容

<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.4"?>
<plugin>

   <extension
         id="application"
         point="org.eclipse.core.runtime.applications">
      <application>
         <run
               class="rcp4.Application">
         </run>
      </application>
   </extension>
   <extension
         point="org.eclipse.ui.perspectives">
      <perspective
            name="Perspective"
            class="rcp4.Perspective"
            id="rcp4.perspective">
      </perspective>
   </extension>
   <extension
         point="org.eclipse.ui.views">
      <view
            name="View"
            class="rcp4.View"
            id="rcp4.view">
      </view>
   </extension>
   <extension
         point="org.eclipse.ui.perspectiveExtensions">
      <perspectiveExtension
            targetID="*">
         <view
               standalone="true"
               minimized="false"
               relative="org.eclipse.ui.editorss"
               relationship="left"
               id="rcp4.view">
         </view>
      </perspectiveExtension>
   </extension>
   <extension
         point="org.eclipse.ui.menus">
      <menuContribution
            locationURI="menu:org.eclipse.ui.main.menu">
         <menu
               label="File">
            <command
                  commandId="org.eclipse.ui.file.exit"
                  label="Exit">
            </command>
         </menu>
      </menuContribution>
   </extension>
   <extension
         id="product"
         point="org.eclipse.core.runtime.products">
      <product
            application="rcp4.application"
            name="RCP4 Product Name">
         <property
               name="appName"
               value="RCP4 Product Name">
         </property>
      </product>
   </extension>

</plugin>

rcp.product content

rcp.product content

<?xml version="1.0" encoding="UTF-8"?>
<?pde version="3.5"?>

<product name="RCP4 Product Name" uid="id" id="rcp4.product" application="rcp4.application" version="0.4.0" useFeatures="false" includeLaunchers="true">

   <configIni use="default">
   </configIni>

   <launcherArgs>
      <vmArgsMac>-XstartOnFirstThread -Dorg.eclipse.swt.internal.carbon.smallFonts</vmArgsMac>
   </launcherArgs>

   <plugins>
   </plugins>


</product>

采纳答案by greg-449

If you are using a .productfile you must add all the plugin or feature dependencies on the Dependenciestab. Your rcp.productfile currently has no dependencies so nothing will be found! There is an Add Requiredbutton on the tab which should add everything required.

如果您使用的是.product文件,则必须在Dependencies选项卡上添加所有插件或功能依赖项。您的rcp.product文件当前没有任何依赖项,因此不会找到任何内容!Add Required选项卡上有一个按钮,可以添加所需的所有内容。

Note: That tutorial looks like it is using an older version of the product file which had dependencies on the Configuration tab.

注意:该教程看起来像是使用旧版本的产品文件,该版本依赖于“配置”选项卡。

Update: To get the correct dependencies first add your own plugin, then press Add Requiredwhich will add a lot of additional plugins. For a very similar plugin (with a different name) on Eclipse 4.3.1 I get:

更新:要获得正确的依赖项,请先添加您自己的插件,然后按Add Required将添加许多其他插件。对于 Eclipse 4.3.1 上非常相似的插件(名称不同),我得到:

<?xml version="1.0" encoding="UTF-8"?>
<?pde version="3.5"?>

<product application="TestRCPView.application" useFeatures="false" includeLaunchers="true">

   <configIni use="default">
   </configIni>

   <launcherArgs>
      <vmArgsMac>-XstartOnFirstThread -Dorg.eclipse.swt.internal.carbon.smallFonts</vmArgsMac>
   </launcherArgs>

   <plugins>
      <plugin id="TestRCPView"/>
      <plugin id="com.ibm.icu"/>
      <plugin id="javax.annotation"/>
      <plugin id="javax.inject"/>
      <plugin id="javax.xml"/>
      <plugin id="org.apache.batik.css"/>
      <plugin id="org.apache.batik.util"/>
      <plugin id="org.apache.batik.util.gui"/>
      <plugin id="org.eclipse.core.commands"/>
      <plugin id="org.eclipse.core.contenttype"/>
      <plugin id="org.eclipse.core.databinding"/>
      <plugin id="org.eclipse.core.databinding.observable"/>
      <plugin id="org.eclipse.core.databinding.property"/>
      <plugin id="org.eclipse.core.expressions"/>
      <plugin id="org.eclipse.core.jobs"/>
      <plugin id="org.eclipse.core.runtime"/>
      <plugin id="org.eclipse.core.runtime.compatibility.registry" fragment="true"/>
      <plugin id="org.eclipse.e4.core.commands"/>
      <plugin id="org.eclipse.e4.core.contexts"/>
      <plugin id="org.eclipse.e4.core.di"/>
      <plugin id="org.eclipse.e4.core.di.extensions"/>
      <plugin id="org.eclipse.e4.core.services"/>
      <plugin id="org.eclipse.e4.ui.bindings"/>
      <plugin id="org.eclipse.e4.ui.css.core"/>
      <plugin id="org.eclipse.e4.ui.css.swt"/>
      <plugin id="org.eclipse.e4.ui.css.swt.theme"/>
      <plugin id="org.eclipse.e4.ui.di"/>
      <plugin id="org.eclipse.e4.ui.model.workbench"/>
      <plugin id="org.eclipse.e4.ui.services"/>
      <plugin id="org.eclipse.e4.ui.widgets"/>
      <plugin id="org.eclipse.e4.ui.workbench"/>
      <plugin id="org.eclipse.e4.ui.workbench.addons.swt"/>
      <plugin id="org.eclipse.e4.ui.workbench.renderers.swt"/>
      <plugin id="org.eclipse.e4.ui.workbench.renderers.swt.cocoa" fragment="true"/>
      <plugin id="org.eclipse.e4.ui.workbench.swt"/>
      <plugin id="org.eclipse.e4.ui.workbench3"/>
      <plugin id="org.eclipse.emf.common"/>
      <plugin id="org.eclipse.emf.ecore"/>
      <plugin id="org.eclipse.emf.ecore.change"/>
      <plugin id="org.eclipse.emf.ecore.xmi"/>
      <plugin id="org.eclipse.equinox.app"/>
      <plugin id="org.eclipse.equinox.common"/>
      <plugin id="org.eclipse.equinox.ds"/>
      <plugin id="org.eclipse.equinox.event"/>
      <plugin id="org.eclipse.equinox.preferences"/>
      <plugin id="org.eclipse.equinox.registry"/>
      <plugin id="org.eclipse.equinox.util"/>
      <plugin id="org.eclipse.help"/>
      <plugin id="org.eclipse.jface"/>
      <plugin id="org.eclipse.jface.databinding"/>
      <plugin id="org.eclipse.osgi"/>
      <plugin id="org.eclipse.osgi.services"/>
      <plugin id="org.eclipse.swt"/>
      <plugin id="org.eclipse.swt.cocoa.macosx.x86_64" fragment="true"/>
      <plugin id="org.eclipse.ui"/>
      <plugin id="org.eclipse.ui.workbench"/>
      <plugin id="org.w3c.css.sac"/>
      <plugin id="org.w3c.dom.smil"/>
      <plugin id="org.w3c.dom.svg"/>
   </plugins>

</product>

回答by Schehter

apt autoremove eclipse* --purge
apt autoremove libosgi* --purge

If you have, then remove this bloatware too:

如果你有,那么也删除这个英国媒体报道:

apt autoremove libmaven* --purge
apt autoremove libsisu* --purge

And then install back:

然后重新安装:

apt install eclipse-cdt

You will get C++ indexer as well.

您还将获得 C++ 索引器。