Java Eclipse:导出为JAR并以Runnable JAR导出之间的差异 [英] Java Eclipse: Difference between exporting as a JAR and exporting as a Runnable JAR

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

问题描述

导出为JAR文件并导出为Runnable JAR文件时,eclipse有什么区别?他们不是都可以运行吗?

解决方案

可运行的jar包含一个MANIFEST.MF文件,它定义了Main类在运行jar时执行。



不可运行的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?

解决方案

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

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天全站免登陆