
Baeldung · 3 min readBackend & APIs
How to Fix the Error: Missing Artifact com.sun:tools:jar in pom.xml Files
Learn why Maven projects may fail with a missing tools.jar error and how to resolve it by configuring the correct JDK, adjusting IDE settings, using profile‑specific dependencies, or excluding obsolete declarations. The guide prevents build breaks across Java 8 and newer versions.
- Set JAVA_HOME to a JDK, not a JRE, to satisfy system‑scoped tools.jar dependencies
- Create a JDK‑8‑only Maven profile to limit tools.jar usage to legacy builds
- Exclude com.sun:tools when the library works with newer JDK APIs