如何分发在 Eclipse 中构建的 Java 项目?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/2332434/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to distribute java project built in Eclipse?
提问by Yatendra Goel
Till now, I have been using Netbeans IDE
for Java Applications. To distribute applications made in Netbeans, I just click on clean and build
and it packs the application in .jar file which resides in a dist
directory.
到目前为止,我一直在Netbeans IDE
用于 Java 应用程序。要分发在 Netbeans 中制作的应用程序,我只需单击clean and build
,它将应用程序打包在位于dist
目录中的 .jar 文件中。
Now I have made a java project in Eclipse
. Is Eclipse has any functionality similar to clean and build
functionality of Netbeans
by which we can pack java applications to distribute them.
现在我已经在Eclipse
. Eclipse 是否具有类似于我们可以打包 Java 应用程序以分发它们的clean and build
功能的任何功能Netbeans
。
回答by brabster
You can right-click the project, select Export and choose Java, then JAR as the format.
您可以右键单击该项目,选择“导出”并选择“Java”,然后选择 JAR 作为格式。
回答by Lombo
File -> Export...
文件 -> 导出...
And choose Java -> JAR File. You will get a wizard to export any of your projects
并选择 Java -> JAR 文件。您将获得一个向导来导出您的任何项目
回答by GuruKulki
Yes it has a clean and build functionality. clean which clean all the developed a classes from the specified location build which builds the class files at the same specified location respectively.
是的,它具有清洁和构建功能。clean 从指定位置清除所有开发的类 build 分别在同一指定位置构建类文件。
To distribute a project as a jar then you have to right click on the project and select export and in that select as jar.
要将项目作为 jar 分发,您必须右键单击该项目并选择导出,然后在该项目中选择为 jar。
回答by GuruKulki
Eclipse has a function to export the whole thing as a exetutable jar. It is under file>export.
Eclipse 具有将整个内容导出为可执行 jar 的功能。它在文件>导出下。