【问题标题】:How to download and use jface如何下载和使用jface
【发布时间】:2018-04-03 22:05:29
【问题描述】:

我想在我自己的 java 程序中使用 JFace,但我不知道如何获得它。

似乎没有像Swt那样的独立下载项目。

我做了一些谷歌搜索,发现一些旧线程说我只需要从 eclipse 中获取 jar 文件。这真的是获得 JFace 的最佳方式吗?

我尝试从我的 eclipse/plugins 文件夹中添加以下 jar 文件:

org.eclipse.jface_3.13.2.v20171022-1656.jar org.eclipse.jface.databinding_1.8.100.v20170503-1507.jar org.eclipse.jface.text_3.12.1.v20171114-1359.jar

当我将它们添加到我的项目中时,我可以编译一个简单的 JFace 测试程序,但是当我尝试运行它时,我得到了

线程“main”中的异常 java.lang.NoClassDefFoundError: org/eclipse/core/runtime/ISafeRunnable

那么JFace 对eclipse 有哪些依赖呢?

【问题讨论】:

    标签: java swt jface


    【解决方案1】:

    [...] 我只需要从 Eclipse 中获取 jar 文件。这真的是获得 JFace 的最佳方式吗?

    据我所知,是的。

    那么JFace对eclipse有哪些依赖呢?

    要使用 JFace,您应该从 eclipse/plugins 文件夹中包含这些 jar:

    org.eclipse.core.commands_<version info>.jar
    org.eclipse.equinox.common_<version info>.jar
    org.eclipse.jface_<version info>.jar
    org.eclipse.osgi_<version info>.jar
    org.eclipse.ui.workbench_<version info>.jar  -> not required but recommended
    

    有关更多信息,请参阅https://wiki.eclipse.org/JFace

    【讨论】:

    • 谢谢,这似乎解决了它。 org.eclipse.jface.databinding_1.8.100.v20170503-1507.jar ./plugins/org.eclipse.jface.text_3.12.1.v20171114-1359.jar 怎么样?从名称上看,它们听起来像是 JFace 的一部分,但文档中没有提及。
    • @MTilsted 不确定,我自己从来不需要它们。
    • @LorisSecuro 我的插件文件夹中没有这些文件。我只有一个名为 org.eclipse.equinox.launcher_1.4.0.v20161219-1356 的文件你知道为什么吗?
    猜你喜欢
    • 1970-01-01
    • 2017-10-30
    • 2014-04-01
    • 2011-01-02
    • 2012-08-31
    • 2019-07-08
    • 2021-03-01
    • 2020-06-12
    • 1970-01-01
    相关资源
    最近更新 更多