# How to Fix the Error: Missing Artifact com.sun:tools:jar in pom.xml Files

DevFeed: [How to Fix the Error: Missing Artifact com.sun:tools:jar in pom.xml Files](<https://devfeed.tech/articles/how-to-fix-the-error-missing-artifact-com-sun-tools-jar-in-pom-xml-files-122665.md>)

Original publisher: [Read original article](<https://www.baeldung.com/maven-pom-missing-tools-jar>)

Author: Hiks Gerganov

Published: 2026-11-08T13:31:31Z

Content type: tutorial

Language: en

Sources: [Baeldung](<https://devfeed.tech/sources/baeldung.md>)

Topics: [Maven](<https://devfeed.tech/topics/maven.md>), [legacy systems](<https://devfeed.tech/topics/legacy-systems.md>)

Tags: [api](<https://devfeed.tech/tags/api.md>), [apis](<https://devfeed.tech/tags/apis.md>), [build](<https://devfeed.tech/tags/build.md>), [ci](<https://devfeed.tech/tags/ci.md>), [command-line](<https://devfeed.tech/tags/command-line.md>), [compilation](<https://devfeed.tech/tags/compilation.md>), [compiler](<https://devfeed.tech/tags/compiler.md>), [dependencies](<https://devfeed.tech/tags/dependencies.md>), [dependency](<https://devfeed.tech/tags/dependency.md>), [development-tools](<https://devfeed.tech/tags/development-tools.md>), [eclipse](<https://devfeed.tech/tags/eclipse.md>), [error](<https://devfeed.tech/tags/error.md>), [how-to](<https://devfeed.tech/tags/how-to.md>), [ide](<https://devfeed.tech/tags/ide.md>), [java](<https://devfeed.tech/tags/java.md>), [jdk](<https://devfeed.tech/tags/jdk.md>), [jvm](<https://devfeed.tech/tags/jvm.md>), [jvm-eclipse-maven-basics-openjdk](<https://devfeed.tech/tags/jvm-eclipse-maven-basics-openjdk.md>), [maven](<https://devfeed.tech/tags/maven.md>), [maven-basics](<https://devfeed.tech/tags/maven-basics.md>), [openjdk](<https://devfeed.tech/tags/openjdk.md>), [pom](<https://devfeed.tech/tags/pom.md>), [system](<https://devfeed.tech/tags/system.md>), [tools](<https://devfeed.tech/tags/tools.md>)

## AI overview

The fix depends on the Java version. With Java 8 or earlier, Maven's system-scoped `com.sun:tools` dependency must point to an installed JDK's `tools.jar`; confirm Maven's runtime with `mvn -version` and set `JAVA_HOME` to the JDK root. In Eclipse, select the JDK under Installed JREs, check any Maven run configuration's JRE, and reimport the project. From JDK 9 onward, `tools.jar` no longer exists, so changing from a JRE to a JDK cannot fix the missing-file error. For builds spanning Java 8 and later, the excerpt shows placing the dependency in a Java 8-only Maven profile; otherwise upgrade the component that declares it or exclude the dependency only if the component works with the target JDK APIs. Use `mvn help:effective-pom` to locate direct and inherited declarations and `mvn dependency:tree -Dincludes=com.sun:tools` for transitive ones. Manually copying or installing the JAR can make builds inconsistent across machines and CI.

## Source excerpt

Learn how to handle a missing tools.jar on newer JDK versions that may be defined as a system dependency in an older Maven project. The post How to Fix the Error: Missing Artifact com.sun:tools:jar in pom.xml Files first appeared on Baeldung.