需求 : 将项目中指定class打成jar包

Step1 : Project Structure -> Artifacts -> 点击 + -> 选择JAR -> Empty

IDEA手动打jar包_其他

 

 Step2 :  Name = jar包名称   Output directory = jar输出路径  Directory Content = 选择jar内容

IDEA手动打jar包_jar包_02

 

 Step3 :  选择class文件

IDEA手动打jar包_其他_03

 

 Step4 :  Build -> Build Artifacts -> 选择要打的jar名称 -> Bulid

IDEA手动打jar包_jar包_04

 

 Step5 : 查看jar内容 (jar -tf jarName.jar)

IDEA手动打jar包_jar包_05