eclipse 产品调用导致 org.eclipse.swt.SWTError 的 ClassNotFoundException

发布于 2025-01-08 10:23:29 字数 1251 浏览 3 评论 0原文

我发现了一个基于 eclipse-rcp 和 xtext 的不错的待办事项工具 (Sebastian Benz - Eclipse 任务编辑器)。我克隆了 git 存储库并导出了产品。不幸的是,我在启动 Eclipse 产品时遇到以下异常:

Caused by: java.lang.ClassNotFoundException: org.eclipse.swt.SWTError
    at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:513)
    at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:429)
    at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:417)
    at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
    ... 43 more

可以找到整个堆栈跟踪 (此处)。我发现一个人有同样的 异常 引起由一些错误的参数。我删除了所有这些,但例外仍然存在。您知道可能导致该问题的原因吗?谢谢你!

我在 Gnome/Linux 上使用 Eclipse Indigo Service Release 1 和以下 java 版本:

java version "1.6.0_26"
Java(TM) SE Runtime Environment (build 1.6.0_26-b03)
Java HotSpot(TM) 64-Bit Server VM (build 20.1-b02, mixed mode)

I found a nice todo-tool that is based on eclipse-rcp and xtext (Sebastian Benz - Eclipse-Task-Editor). I cloned the git repository an exported the product. Unfortunately, I'm getting following exception as starting the eclipse product:

Caused by: java.lang.ClassNotFoundException: org.eclipse.swt.SWTError
    at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:513)
    at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:429)
    at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:417)
    at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
    ... 43 more

The entire stack trace can be found (here). I found a guy having the same exception caused by some wrong parameters. I removed all of them but the exception is still present. Do you have a clue what could cause the issue? Thank you!

I use Eclipse Indigo Service Release 1 on Gnome/Linux with the following java version:

java version "1.6.0_26"
Java(TM) SE Runtime Environment (build 1.6.0_26-b03)
Java HotSpot(TM) 64-Bit Server VM (build 20.1-b02, mixed mode)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

万人眼中万个我 2025-01-15 10:23:29

也许,应用程序在您的插件文件夹中找不到正确的 swt 库。你需要一个名为“org.eclipse.swt.gtk.linux.x86_64_xxxx.jar”的jar。你可以检查一下。

Maybe , the application not found the right swt lib in your plugin folder. you need a jar named "org.eclipse.swt.gtk.linux.x86_64_xxxx.jar". you can check it.

北斗星光 2025-01-15 10:23:29

我通过编辑根 pom.xml 解决了“相同/相似”问题,如下所示:

      <build>
        <plugins>
          <plugin>
            <groupId>${tycho-groupid}</groupId>
            <artifactId>target-platform-configuration</artifactId>
            <version>${tycho-version}</version>
            <configuration>
              <resolver>p2</resolver>
              <target>
                <artifact>
                  <groupId>de.sebastianbenz.task.tools</groupId>
                  <artifactId>de.sebastianbenz.task.target</artifactId>
                  <version>${task-editor-version}</version>
                  <classifier>indigo</classifier>
                </artifact>
              </target>
              <ignoreTychoRepositories>true</ignoreTychoRepositories>
              <environments>
    <!-- 
                 <environment>
                  <os>macosx</os>
                  <ws>cocoa</ws>
                  <arch>x86_64</arch>
                </environment>
                <environment>
                  <os>win32</os>
                  <ws>win32</ws>
                  <arch>x86</arch>
                </environment>
                <environment>
                  <os>win32</os>
                  <ws>win32</ws>
                  <arch>x86_64</arch>
                </environment>
                <environment>
                  <os>linux</os>
                  <ws>gtk</ws>
                  <arch>x86</arch>
                </environment>
     -->
                <environment>
                  <os>linux</os>
                  <ws>gtk</ws>
                  <arch>x86_64</arch>
                </environment>
              </environments>
            </configuration>
          </plugin>
          <plugin>
            <groupId>${tycho-groupid}</groupId>
            <artifactId>tycho-maven-plugin</artifactId>
            <version>${tycho-version}</version>
            <extensions>true</extensions>
          </plugin>
        </plugins>
      </build>

I solved the 'same/a similar' problem by editing the root pom.xml like so:

      <build>
        <plugins>
          <plugin>
            <groupId>${tycho-groupid}</groupId>
            <artifactId>target-platform-configuration</artifactId>
            <version>${tycho-version}</version>
            <configuration>
              <resolver>p2</resolver>
              <target>
                <artifact>
                  <groupId>de.sebastianbenz.task.tools</groupId>
                  <artifactId>de.sebastianbenz.task.target</artifactId>
                  <version>${task-editor-version}</version>
                  <classifier>indigo</classifier>
                </artifact>
              </target>
              <ignoreTychoRepositories>true</ignoreTychoRepositories>
              <environments>
    <!-- 
                 <environment>
                  <os>macosx</os>
                  <ws>cocoa</ws>
                  <arch>x86_64</arch>
                </environment>
                <environment>
                  <os>win32</os>
                  <ws>win32</ws>
                  <arch>x86</arch>
                </environment>
                <environment>
                  <os>win32</os>
                  <ws>win32</ws>
                  <arch>x86_64</arch>
                </environment>
                <environment>
                  <os>linux</os>
                  <ws>gtk</ws>
                  <arch>x86</arch>
                </environment>
     -->
                <environment>
                  <os>linux</os>
                  <ws>gtk</ws>
                  <arch>x86_64</arch>
                </environment>
              </environments>
            </configuration>
          </plugin>
          <plugin>
            <groupId>${tycho-groupid}</groupId>
            <artifactId>tycho-maven-plugin</artifactId>
            <version>${tycho-version}</version>
            <extensions>true</extensions>
          </plugin>
        </plugins>
      </build>
洛阳烟雨空心柳 2025-01-15 10:23:29

不管你相信与否,我只需从不同的镜像下载相同版本的 Eclipse 就可以解决导出问题 - 最初我从滑铁卢大学下载它,第二次从宾夕法尼亚大学镜像下载。我在删除之前的 Eclipse 安装并在新实例上重新导入它们之前备份了这些项目。产品出口工作顺利。我正在为 RAP 和 RCP 开发人员使用 Eclipse 3.7.2 - Indigo。

Believe it or not, I was able to solve the export problem by simply downloading the same version of Eclipse but from a different mirror - initially I downloaded it from the U of Waterloo and the 2nd time around from the U of Pennsylvania mirror. I backed up the projects before blowing away the previous Eclipse installation and re-imported them on the new instance. The product export worked without a hitch. I am using Eclipse 3.7.2 - Indigo for RAP and RCP developers.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文