从 Eclipse 项目创建批处理文件

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/2776786/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 14:43:13  来源:igfitidea点击:

Create Batch File From Eclipse Project

javaeclipseeclipse-plugin

提问by Dan Rosenstark

How can I create a runtime package of some sort -- an all-in-one jar with the Main class specified, a Mac .app, or similar -- from an Eclipse Java project? I would like to get all the required jars and so forth without having to make the batch file myself.

如何.app从 Eclipse Java 项目创建某种类型的运行时包——指定 Main 类的一体式 jar、Mac或类似的?我想获得所有必需的 jars 等等,而不必自己制作批处理文件。

采纳答案by jwaddell

Right-click on your project in Eclipse, and select Export. Select Java->Runnable JAR File.

在 Eclipse 中右键单击您的项目,然后选择Export。选择Java->Runnable JAR File

You can then select a particular Eclipse Launch Configuration on which to base the export (i.e. the main class and the classpath used to run it), whether to extract or package the required libraries, and whether to create an ANT script (so you could build the JAR file outside of Eclipse).

然后,您可以选择一个特定的 Eclipse Launch Configuration 作为导出的基础(即主类和用于运行它的类路径),是否提取或打包所需的库,以及是否创建 ANT 脚本(以便您可以构建Eclipse 之外的 JAR 文件)。