且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

创建并运行Jar文件

更新时间:2023-09-29 22:11:16

你可以使用 jar cf yourCompAppJar.jar Main.class 来创建你的jar文件,如果你有JDK 6就可以使用 cfe 指定入口点。

You can use jar cf yourCompAppJar.jar Main.class to create your jar file, if you have JDK 6 you can use the cfe to specify the entry point.

如果您使用的是Eclipse:

If you are using Eclipse :


  • 右键单击项目> 单击导出> 选择Java文件夹下的Runnable JAR文件> 在启动配置中选择班级名称> 选择保存罐子的位置> 完成。

  • Right-click the project > click Export > select "Runnable JAR file" under the Java folder > In the launch configuration select the class name > choose where to save your jar > finish.