Java Eclipse:导出为 JAR 和导出为 Runnable JAR 之间的区别 [英] Java Eclipse: Difference between exporting as a JAR and exporting as a Runnable JAR

查看:23
本文介绍了Java Eclipse:导出为 JAR 和导出为 Runnable JAR 之间的区别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

eclipse 中导出为 JAR 文件和导出为 Runnable JAR 文件有什么区别?他们不是都可以运行吗?各自的优缺点是什么?

What is the difference in eclipse between exporting as a JAR file and exporting as a Runnable JAR file? Aren't they both runnable? What are the pros/cons of each?

推荐答案

runnable jar 包含一个 MANIFEST.MF 文件,该文件定义了运行 jar 时要执行的 Main 类.

The runnable jar contains a MANIFEST.MF file, which defines the Main class to be executed when the jar is run.

不可运行的 jar 只是类库,可以将其添加到类路径中以便重用代码(它还包含清单文件,但没有主类)

Non-runnable jars are just libraries of classes, that can be added to the classpath so that code is reused (it also contains the manifest file, but no main class there)

这篇关于Java Eclipse:导出为 JAR 和导出为 Runnable JAR 之间的区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆