First, import
1. Java project before the jar package is imported,
2. Click File--Project Structure (shortcut CTRL + ALT + Shift + s), click "Modules" on the left side of the project Structure interface
3, in the "Dependencies" tab screen, click on the right Green "+" number, select the first option "JARs or directories ...", select the appropriate jar package, click "OK", the jar package added successfully
4, point "OK" back to the project interface, IntelliJ idea automatically prompt to add import statements, with the Alt+enter key to quickly add import statements, the project successfully compiled
Second, hit the Jar bag
1. Click File--Project Structure (shortcut CTRL + ALT + Shift + s), click "Artifacts" on the left side of the project Structure interface
2, artifacts-> "+", choose the jar, select from modules with dependencies, after the configuration window appears, after the configuration is complete, tick build on make >ok save
3, Menu: Build->make Project, note that there may be a compilation error, it is best to check the compiler version in advance: File>settings>java Compiler, modify the target bytecode Version 1.8, project version structure-project/modules to 1.8
The following is a review of the compiler version, which can be ignored when not required:
(1) File>settings>java Compiler, modify target bytecode version 1.8
(2) Project structure>project/modules version changed to 1.8
4, go to package output path, find jar Package
IntelliJ Idea Java Project import jar package, hit jar package