简体   繁体   English

如何使用Eclipse JDT API创建可运行的jar?

[英]How to create a runnable jar with the eclipse jdt API?

When we are in Eclipse IDE and right-click on a java project, we have the option to export that project as a runnable Jar file . 在Eclipse IDE中并右键单击Java项目时,我们可以选择将该项目导出为可运行的Jar文件

It exists, thus, some code that uses the jdt API to accomplish this task. 因此,它存在一些使用jdt API来完成此任务的代码。

I know the package used should be org.eclipse.jdt.ui.jarpackager but I couldn't find how. 我知道使用的软件包应该是org.eclipse.jdt.ui.jarpackager,但我找不到方法。

Does anybody know something more? 有人知道更多吗?

To be clear, I'd like to start in my program (eclipse plug-in) with a JProject object and be able to save a jar file (and later load the same) in the workspace. 为了清楚起见,我想使用JProject对象在程序(Eclipse插件)中启动,并能够在工作区中保存jar文件(并稍后将其加载)。

EDIT: It's a programming problem. 编辑:这是一个编程问题。 I don't know how to use the classes of org.eclipse.jdt.ui.jarpackager to transform a JProject in a runnable Jar file . 我不知道如何使用org.eclipse.jdt.ui.jarpackager类来在可运行的Jar文件中转换JProject

Solved by myself. 由我自己解决。

I simply extended the fatJarExportWizard and used it. 我只是扩展了fatJarExportWizard并使用了它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM