标签: eclipse-plugin

Eclipse RCP:java.lang.ClassNotFoundException一个运行时

我的一个插件使用了一个库(jar文件).

  1. 我在我的插件中创建了一个名为lib的文件夹,并将jar文件放入其中.
  2. 我通过添加带有"Add JARS .."的jar文件来配置构建路径.
  3. 我在插件中使用jar文件的类,它编译得很好.
  4. 我启动RCP并获取有关jar文件中的类的ClassNotFoundException.

我错过了什么?

java eclipse eclipse-plugin jar eclipse-rcp

3
推荐指数
1
解决办法
1623
查看次数

Eclipse Juno在Splash屏幕后崩溃

我的日食工作正常,但是当我重新启动电脑时,它突然停止工作.现在,它只是显示启动画面然后消失.

从日志文件中我得到以下例外:

!SESSION 2014-06-24 10:41:35.291 -----------------------------------------------
eclipse.buildId=M20120914-1800
java.version=1.7.0_45
java.vendor=Oracle Corporation
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_IN
Framework arguments:  -product org.eclipse.epp.package.jee.product
Command-line arguments:  -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.jee.product

This is a continuation of log file D:\and_workspace\.metadata\.bak_0.log
Created Time: 2014-06-24 10:43:13.576

!ENTRY org.eclipse.ui 4 0 2014-06-24 10:43:13.576
!MESSAGE Error occurred during status handling
!STACK 0
java.lang.NullPointerException
    at org.eclipse.ui.internal.statushandlers.StatusHandlerRegistry.<init>(StatusHandlerRegistry.java:72)
    at org.eclipse.ui.internal.statushandlers.StatusHandlerRegistry.getDefault(StatusHandlerRegistry.java:91)
    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$StatusManagerLogListener.logging(StatusManager.java:305)
    at org.eclipse.core.internal.runtime.RuntimeLog.logToListeners(RuntimeLog.java:160)
    at org.eclipse.core.internal.runtime.PlatformLogWriter.logged(PlatformLogWriter.java:100)
    at org.eclipse.equinox.log.internal.ExtendedLogReaderServiceFactory.safeLogged(ExtendedLogReaderServiceFactory.java:86)
    at org.eclipse.equinox.log.internal.ExtendedLogReaderServiceFactory.logPrivileged(ExtendedLogReaderServiceFactory.java:205)
    at org.eclipse.equinox.log.internal.ExtendedLogReaderServiceFactory.log(ExtendedLogReaderServiceFactory.java:178)
    at …
Run Code Online (Sandbox Code Playgroud)

eclipse eclipse-plugin eclipse-juno

3
推荐指数
1
解决办法
2011
查看次数

Eclipse插件:启动后立即运行代码

我想在插件启动后立即显示一条消息.如果我将我的代码放在Activator.start()方法的末尾,我会收到一个错误(可能是因为尚未加载所需的资源).

错误看起来像这样:

!MESSAGE While loading class "de.stefansurkamp.package.ClassIWantToLoad", thread "Thread[main,6,main]" timed out waiting (5006ms) for thread "Thread[Worker-2,5,main]" to finish starting bundle "MyPlugin_1.0.0.qualifier [302]". To avoid deadlock, thread "Thread[main,6,main]" is proceeding but "de.stefansurkamp.package.ClassIWantToLoad" may not be fully initialized.
!STACK 0
org.osgi.framework.BundleException: State change in progress for bundle "reference:file:/C:/Users/Stefan/workspace/MyPlugin/" by thread "Worker-2".
    at org.eclipse.osgi.framework.internal.core.AbstractBundle.beginStateChange(AbstractBundle.java:1088)
    at org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:298)
    at org.eclipse.osgi.framework.util.SecureAction.start(SecureAction.java:478)
    at org.eclipse.osgi.internal.loader.BundleLoader.setLazyTrigger(BundleLoader.java:263)
    at org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:109)
    [...]
Caused by: org.eclipse.osgi.framework.internal.core.AbstractBundle$BundleStatusException
    ... 53 more
Root exception:
org.eclipse.osgi.framework.internal.core.AbstractBundle$BundleStatusException
    [...]
Run Code Online (Sandbox Code Playgroud)

如果需要,我可以提供完整的堆栈跟踪.

那么有没有任何方法在start()完成后立即运行?

编辑:使用作业和org.eclipse.ui.startup

根据greg的建议,我在一个由org.eclipse.ui.startup扩展点加载的类中创建了一个Job …

java eclipse eclipse-plugin startup eclipse-jdt

3
推荐指数
1
解决办法
1542
查看次数

在Eclipse Luna中安装spring插件

我下载了Eclipse Luna,我想安装spring的插件有什么区别:Spring IDE插件和Spring工具套件插件?我应该下载哪一个?

Eclipse + Spring Tool套件插件= Spring Tool Suite发布?

eclipse spring eclipse-plugin java-ee spring-tool-suite

3
推荐指数
1
解决办法
2万
查看次数

无法为eclipse luna安装maven插件

我试图通过eclipse市场安装eclipse luna的maven插件,但是我得到以下错误.

Cannot complete the install because one or more required items could not be found.
  Software being installed: Maven Development Tools 0.3.0.201410040035 (com.ifedorenko.m2e.mavendev.feature.feature.group 0.3.0.201410040035)
  Missing requirement: Maven Development Tools 0.3.0.201409160039 (com.ifedorenko.m2e.mavendev 0.3.0.201409160039) requires 'bundle org.eclipse.m2e.launching [1.6.0,2.0.0)' but it could not be found
  Cannot satisfy dependency:
    From: Maven Development Tools 0.3.0.201410040035 (com.ifedorenko.m2e.mavendev.feature.feature.group 0.3.0.201410040035)
    To: com.ifedorenko.m2e.mavendev [0.3.0.201409160039]
Run Code Online (Sandbox Code Playgroud)

请帮助我如何解决这个问题.我的所有环境变量也都设置正确.

eclipse eclipse-plugin maven-3

3
推荐指数
1
解决办法
1万
查看次数

如何从插件中引用图标?

我有一个带有一些插件和一些命令的Eclipse RCP应用程序.对于其中一个命令,我想使用其中一个插件中的图标.

调用插件com.example.plugin.workspace,图标的路径是icons/workspace.png.

我想在我的应用程序的plugin.xml中引用它,我想将命令添加到工具栏:

<menuContribution
        allPopups="false"
        locationURI="toolbar:org.eclipse.ui.main.toolbar?after=additions">
    <toolbar
           id="com.example.application.displays.toolbar">
        <command
             commandId="com.example.application.system.command.OpenWorkspace"
             icon="PATH TO ICON IN PLUGIN"
             label="Open Workspace"
             style="push">
        </command>
    </toolbar>
</menuContribution>
Run Code Online (Sandbox Code Playgroud)

我可以在那里引用插件的图标,如果是的话,怎么样?

eclipse eclipse-plugin eclipse-rcp

3
推荐指数
1
解决办法
1451
查看次数

IDocument无法解析为某种类型

我是eclipse插件devalopment的新手,我想使用eclipse插件从编辑器获取内容,所以我找到了这个答案.

但问题是:我得到了编译错误IDocument cannot be resolved to a type.没有可用的快速修复导入.我的Eclipse版本是3.8.2.

我该如何解决这个问题?

我使用的代码(来自链接的答案)是这样的:

public String getCurrentEditorContent() {
    final IEditorPart activeEditor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage()
            .getActiveEditor();
    if (activeEditor == null)
        return null;
    final IDocument doc = (IDocument) activeEditor.getAdapter(IDocument.class);
    if (doc == null) return null;

    return doc.get();
}
Run Code Online (Sandbox Code Playgroud)

在此输入图像描述

我找不到org.eclipse.jface.text我的依赖项.这是一个快照:

在此输入图像描述

java eclipse-plugin

3
推荐指数
1
解决办法
1164
查看次数

在Eclipse中添加以前删除的Tomcat 7服务器

我正在使用Eclipse Luna,我从Eclipse添加了Tomcat 7服务器.但后来我删除了它,现在我无法添加它.当我单击,添加新服务器并选择Tomcat 7时,服务器名称将变空并且我没有看到启用"完成"按钮以添加此Tomcat 7服务器.以前,它显示为"本地主机上的Tomcat v7.0服务器",但是由于我删除了它,它不再出现,我根本无法添加它.

非常感谢在Eclipse中添加Tomcat 7服务器.

谢谢

eclipse eclipse-plugin m2eclipse tomcat7

3
推荐指数
1
解决办法
4285
查看次数

当自动化Eclipse的"Export as Feature"时,Maven/Tycho没有看到我的插件

我的工作区中有一个插件和一个功能项目.当我通过文件>导出为>功能手动导出功能时,一切正常.我正在尝试编写一个自动插件构建和导出脚本来摆脱这些苦差事.我将功能项目转换为Maven项目并填充pom.xml:

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
   <modelVersion>4.0.0</modelVersion>

   <groupId>MyProject</groupId>
   <artifactId>NMGDBPluginFeature</artifactId>
   <version>1.0.0-SNAPSHOT</version>
   <packaging>eclipse-feature</packaging>

   <properties>
      <tycho-version>0.22.0</tycho-version>
      <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>  
   </properties>

   <repositories>
      <repository>
         <id>eclipse-luna</id>
         <layout>p2</layout>
         <url>http://download.eclipse.org/releases/luna</url>
      </repository>
   </repositories>

   <build>
      <plugins>
         <plugin>
            <groupId>org.eclipse.tycho</groupId>
            <artifactId>tycho-maven-plugin</artifactId>
            <version>${tycho-version}</version>
            <extensions>true</extensions>
         </plugin>
      </plugins>
   </build>

</project>
Run Code Online (Sandbox Code Playgroud)

但脚本抛出:

[ERROR] Cannot resolve project dependencies:
[ERROR]   Software being installed: NMGDBPluginFeature.feature.group 1.0.0.qualifier
[ERROR]   Missing requirement: NMGDBPluginFeature.feature.group 1.0.0.qualifier requires 'GDBFifoBlocks [1.0.0.gdbfifoblocks]' but it could not be found
Run Code Online (Sandbox Code Playgroud)

怎么会发生这种情况?我以为pom.xml使用了项目的feature.xml,不是吗?什么是正确的配置?

eclipse eclipse-plugin tycho maven

3
推荐指数
1
解决办法
481
查看次数

添加MessageDialog消息的链接

我在做Eclipse插件开发.我正在上课MessageDialog.API可以在这里找到.

我想在消息中添加一个像我这样做的链接"here" MessageDialog.

这是我在做的事情:

String errorMessage = "You have received an error. Please visit " + URL_NEEDED_HERE

MessageDialog.openError(getShell(), "Get Existing Data Sources Error", errorMessage);
Run Code Online (Sandbox Code Playgroud)

URL一直显示为String.它可以显示为链接吗?

java eclipse eclipse-plugin eclipse-rcp

3
推荐指数
1
解决办法
1321
查看次数