Creating JAR File

file → project structure → project settings → artifacts → + → JAR → from modules with dependencies

  • choose main class
  • extract to the target JAR
  • change Directory for META-INF/MANIFEST.MF to point to resources
    • /src/main/java
    • /src/main/resources

Build JAR File

build → build artifacts… → choose jar → build

JAR file will be in /out/artifacts/…

Run JAR File

java -jar example.jar