如何用eclipse生成jar文件

2025-04-04 19:02:54
推荐回答(2个)
回答1:

  工具:

  eclipse

  方法:

  1. 工程中不包含第三方的jar包选中需要生成jar的工程,右击-->Export,出现如下的窗口

  2. 选中java--- > JAR file,出现如下窗口,

    此处要:

    选中 Export generated class files and resources; 
    选中 Compress the contents of the JAR file; 
    选中 Overwrite existing files without warning;

  3. 然后“Next”,出现如下窗口

    选中 Export class files with compile errors; 
    选中 Export class files with compile warnings;

  4. 点击“Next”,出现如下窗口

    选择“Main class”,then “finish” OK。

回答2:

选定项目,点击右键:

点击Export,选定jar,如图:

填入需要导出的jar的名字和路径,