How to build jars from IntelliJ properly?

前端 未结 20 2756
盖世英雄少女心
盖世英雄少女心 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 01:59

    I recently had this problem and think these steps are easy to follow if any prior solution or link is missing detail.

    How to create a .jar using IntelliJ IDEA 14.1.5:

    1. File > Save All.
    2. Run driver or class with main method.
    3. File > Project Structure.
    4. Select Tab "Artifacts".
    5. Click green plus button near top of window.
    6. Select JAR from Add drop down menu. Select "From modules with dependencies"
    7. Select main class.
    8. The radio button should be selecting "extract to the target JAR." Press OK.
    9. Check the box "Build on make"
    10. Press apply and OK.
    11. From the main menu, select the build dropdown.
    12. Select the option build artifacts.

提交回复
热议问题