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

时间:2014-01-15 05:31:40

标签: java eclipse eclipse-rcp eclipse-plugin

我使用Eclipse 4.3.0开发插件/ RCP。 在尝试按照插件开发101,第2部分:由Chris Aniszczyk 2008介绍富客户端应用程序http://www.ibm.com/developerworks/library/os-eclipse-plugindev2/进行RCP产品时,从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$1.run(URLClassLoader.java:366)
    at java.net.URLClassLoader$1.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)

更多信息

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

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

<?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>

2 个答案:

答案 0 :(得分:6)

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

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

更新: 要获得正确的依赖项,请先添加自己的插件,然后按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>

答案 1 :(得分:1)

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

如果有,请删除此英国媒体报道:

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

然后安装回来:

apt install eclipse-cdt

你也将获得C ++索引器。