How to build jars from IntelliJ properly?

前端 未结 20 2473
盖世英雄少女心
盖世英雄少女心 2020-11-22 01:14

I have a project that contains a single module, and some dependencies. I\'d like to create a jar, in a separate directory, that contains the compiled module. In addition, I\

20条回答
  •  孤街浪徒
    2020-11-22 02:08

    If you are using third party libraries with your project or if you have problems with creating MANIFEST.MF file properly, there can be conflicts when running JAR files generated using

    File > Project Structure > Artifacts > '+' > JAR > From modules with dependencies > .....
    

    method mentioned above.

    Instead I suggest you to create an empty JAR and add all other elements to the output root manually. A wonderful blog article for this method can be found here: http://karthicraghupathi.com/2016/07/10/creating-an-executable-jar-in-intellij-idea/ I tried the steps mentioned there and everything worked fine for me!

提交回复
热议问题