Home >Java >javaTutorial >How to Include External Libraries in IntelliJ IDEA Artifact JARs?
Including External Libraries in Artifact JARs with IntelliJ IDEA
When building artifact JARs in IntelliJ IDEA, it's crucial to include essential external libraries. However, sometimes developers encounter challenges in ensuring that the libraries remain accessible during runtime.
To resolve this issue, there are two primary approaches:
1. Extract Dependencies into Artifact JAR:
This method integrates the external dependency into the artifact JAR, creating a standalone executable that contains all required dependencies.
Steps:
2. Link Dependent JARs via Manifest.MF and Copy:
Alternatively, dependent JARs can be linked via the project's Manifest.MF file and copied alongside the main artifact JAR.
Steps:
Add the following line to the "Class-Path" attribute:
Class-Path: path/to/dependency.jar
The above is the detailed content of How to Include External Libraries in IntelliJ IDEA Artifact JARs?. For more information, please follow other related articles on the PHP Chinese website!