运行基于jface的程序时,有时会出现 can not find main class 错误. 而程序看起来似乎毫无错误.这时应该检查一下jface的依赖项. 而jface在不同的版本却有不同的依赖项,应该如何找到你所使用的jface的依赖项呢?不用google了,这里有你要的答案.
打开eclipse菜单: Window/Show View/PDE/Plug-ins.
这样,就打开了Plug-in Dependencies视图.
选择jface,这样就可以得到dependencies,将相应插件添加进build path就可以了.
参考:
[urlhttp://wiki.eclipse.org/JFace#Identify_the_Required_External_JAR_Files_for_SWT_and_JFace][/url]
原文:
Identify the Required External JAR Files for SWT and JFace
A JFace project requires the SWT classes, JFace classes, and other Eclipse classes that JFace is dependent on. The SWT classes will be provided in the file we download from the SWT Project Website. The JFace file, and the files the JFace is dependent upon, need to be added to the project manually.
The first step is to identify the required JAR files for JFace. The primary file is called org.eclipse.jface, followed by specific version information. In addition, this file requires classes from other Eclipse JAR files. For Eclipse version 3.3.1.1, the required JAR files for JFace are as follows (where <version info> is the specific version information):
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
The file org.eclipse.ui.workbench_<version info>.jar is not required to run the standard JFace classes. However, since it adds a number of very useful Dialogs (such as ListDialog, ListSelectionDialog, and others), it is included here as well.
You can find the JFace dependencies for any Eclipse version if you have the Plug-in Development Environment, which includes the Plug-ins and Plug-in Dependencies views. To do this:
1.Select Window/Show View/PDE/Plug-ins. (Note, if you don't have a PDE view folder, it means you don't have the Plug-in Developer Environment plug-in in your Eclipse installation.)
2.Select the org.eclipse.jface plug-in from the list.
3.Right-click and select Open Dependencies. This will open the Plug-in Dependencies view. An example of this view for Eclipse version 3.3.1.1 is shown below.
4.Press the Set Flat Layout button to see a simple flat list of the required plug-ins, as shown below.
5.Each plug-in on the list corresponds to a JAR file in the plugins directory for your Eclipse installation. If the list for your Eclipse version is different than the list above, make a note of it and modify the remaining instructions accordingly. At this point, we have the list of JAR files that we need.
分享到:
相关推荐
Eclipse是一款广泛使用的开源集成开发环境(IDE),主要用于Java...site.xml、features和plugins目录则包含了安装和运行这些功能所需的所有组件。对于从事Java移动开发的中国开发者来说,这是一个非常实用的工具包。
这个"dropins"目录是Eclipse用来自动识别和安装插件的地方。一旦完成解压,Eclipse在下次启动时会自动检测到新添加的插件,并进行安装。确保Eclipse版本与提供的WindowBuilder插件兼容,否则可能会出现安装问题。 ...
- `plugins`:可能包含插件所需的其他组件或依赖的Eclipse插件。 - `web`:可能是一个Web服务器相关的目录,用于在线展示插件信息或提供在线服务。 - `features`:通常包含插件的功能描述和配置信息,Eclipse使用...
因此,这个JAR文件可能包含了实现代码去空格和自动上屏功能所需的部分组件或API。 要实现这个功能,用户可能需要进行以下操作: 1. 确保MyEclipse版本与提供的解决方案或插件兼容。 2. 下载并安装相关的插件或更新...
"dropins"目录是Eclipse用来自动识别和加载插件的地方。 Eclipse的安装目录结构通常是这样的: ``` Eclipse安装目录 │ ├── dropins │ └── 汉化资源文件夹 │ ├── plugins │ └── ... ``` 移动汉化...
在Eclipse中,SWT Designer是一个强大的插件,它提供了图形化界面来设计和编辑SWT/JFace应用。通过拖放控件,设置属性,开发者可以快速创建复杂的GUI,而无需编写大量手动布局代码。这极大地提高了开发效率,使得...
- 配置所需的规则,例如缩进、括号位置等,并保存设置。 **5. 内容辅助设置** 内容辅助可以帮助开发者快速补全代码片段,提高编码效率: - 进入“首选项”的“Java > Editor > Content Assist”。 - 可以调整自动...
JDK是Java开发工具包的简称,它是Java语言的核心组成部分之一,包含了编译、调试和运行Java程序所需的各种工具。JDK不仅包括Java编译器(javac)、Java运行时环境(JRE),还包括了大量的标准类库,这些类库提供了...