How do I make a JAR from a .java file?

前端 未结 7 1112
太阳男子
太阳男子 2020-11-29 17:55

I was writing a simple program using a Java application (not application that has projects, but application within a project; .java) that has a single frame. Both o

相关标签:
7条回答
  • 2020-11-29 18:39

    Open a command prompt.

    Go to the directory where you have your .java files

    Create a directory build

    Run java compilation from the command line

    javac -d ./build *.java
    

    if there are no errors, in the build directory you should have your class tree

    move to the build directory and do a

    jar cvf YourJar.jar *
    

    For adding manifest check jar command line switches

    0 讨论(0)
提交回复
热议问题