Some links on this page are affiliate links: if you buy through them we may earn a commission, at no extra cost to you.
If Eclipse reports that a project is “missing a required library,” it usually cannot resolve an entry on the project’s Java Build Path. The right fix depends on what that entry represents: a JAR, another workspace project, a classpath variable, a JRE, or a dependency managed by Maven, Gradle, or PDE. First identify the project type and broken entry; adding a random JAR can make compilation appear fixed while leaving runtime or deployment failures behind.
“Non-required library” is not a standard Eclipse category. If you mean a library configured separately rather than as a required project dependency, it may be an external JAR, user library, variable-based entry, or build-tool dependency. The steps below help distinguish these cases.
| # | Preview | Product | Price | |
|---|---|---|---|---|
| 1 |
|
Eclipse IDE Pocket Guide: Using the Full-Featured IDE | $7.99 | Buy on Amazon |
| 2 |
|
Eclipse | $25.99 | Buy on Amazon |
| 3 |
|
Eclipse IDE - kurz & gut | $6.53 | Buy on Amazon |
| 4 |
|
Eclipse IDE - kurz & gut | $7.02 | Buy on Amazon |
| 5 |
|
Contributing to the Eclipse IDE Project: Principles, Plug-ins and Gerrit Code Review (vogella... | $24.99 | Buy on Amazon |
Find the broken build-path entry
Eclipse’s Java Build Path tells the compiler which source folders, projects, class files, JARs, and containers it can use. A missing entry is a build-path problem; it does not necessarily mean the library must be included in the application at runtime. Eclipse stores Java build-path configuration in the project’s .classpath file, but the Properties page is usually the safest place to inspect and repair it. See Eclipse’s build classpath overview and classpath documentation.
- Select the project in Package Explorer or Project Explorer.
- Open Project → Properties → Java Build Path.
- Inspect Libraries for JARs, JRE System Library, variables, user libraries, and containers; Projects for workspace dependencies; and Order and Export for visibility and order. For Java 9 and later, also inspect Module Dependencies.
- Check the Problems view and the project’s Referenced Libraries node for the exact unresolved name or path.
| What the error points to | Where to repair it |
|---|---|
| Missing JAR or class folder | Java Build Path → Libraries |
| Missing required Java project | Import or restore the project, then Java Build Path → Projects |
| Unbound classpath variable | Window → Preferences → Java → Build Path → Classpath Variables |
| Missing JRE System Library or Java runtime types | Installed JREs and the project’s JRE System Library |
| Maven dependency/container | pom.xml, then refresh the Maven project |
| Gradle dependency/container | Gradle build file, then refresh the Gradle project |
| Plug-in bundle | MANIFEST.MF, target platform, and PDE tools |
| Module resolution error | Classpath or Modulepath placement and module-info.java |
Eclipse’s Java Build Path reference describes these tabs and the library types they support. Menu wording can vary somewhat between Eclipse releases and installed integrations.
#1 Best Overall
Fix a missing JAR in a plain Java project
Use manual JAR configuration when the project is genuinely a plain Eclipse Java project and the dependency is intentionally managed as a local or standalone file.
- Open Project → Properties → Java Build Path → Libraries.
- Select the missing entry. Choose Edit if the file moved, or Remove if the entry is obsolete. Removing an entry from the build path does not delete the file.
- Choose Add JARs for a JAR inside the workspace, or Add External JARs for a JAR elsewhere on the computer. Select the intended file and choose Apply and Close.
- Run Project → Clean if the error marker remains, then rebuild.
Before adding a replacement, verify that it contains the package and class the code imports and that its version is compatible with the project. A similar filename is not enough: the wrong release may omit methods, conflict with another version, or introduce duplicate classes. Avoid adding every JAR in a lib folder as a first response; that can introduce version conflicts, unnecessary deployment files, and dependencies the project does not need.
An external JAR entry may point to a machine-specific location. For a shared project, a workspace-relative JAR, a documented classpath variable, or a build-tool declaration is generally more portable than an absolute path.
When Eclipse says a Java project is missing
A project dependency is different from a JAR. Import or restore the missing project into the workspace and confirm Eclipse recognizes it as a Java project. Then open the consuming project’s Properties → Java Build Path → Projects, choose Add, select the required project, and apply the change. Check Project References if the dependency is not reflected there.
Rank #2
Make sure the referenced project is open and builds successfully. If it is present but unresolved, check whether its name differs from the one recorded in the consuming project, whether it was imported as a general rather than Java project, or whether its own build path has errors. Project dependencies also influence build order; exported entries from a referenced project may be visible to projects that depend on it.
Repair an unbound classpath variable or user library
A classpath variable replaces a machine-specific path with a named reference. It is useful when developers install the same SDK or library in different locations, but each workspace must map the variable correctly.
- Open Window → Preferences → Java → Build Path → Classpath Variables.
- Select the unresolved variable and choose Edit, or choose New if it is undefined.
- Point it to the correct JAR or folder, apply the change, and verify that the project’s Libraries entry now resolves.
- Clean and rebuild if needed.
See Eclipse’s guidance on classpath variables and configuring them. Do not recreate the reserved, deprecated JRE_LIB, JRE_SRC, or JRE_SRCROOT variables to fix a broken runtime entry; use a JRE System Library instead.
The Tool Desk
Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →If the missing entry is a named collection shared by legacy Eclipse projects, open Window → Preferences → Java → Build Path → User Libraries, edit the library and replace its missing JAR, then verify it under the project’s Libraries tab. User Libraries are convenient for Eclipse workspaces but are less reproducible in CI and across workspaces than dependencies declared in Maven or Gradle. JAR ordering can matter if archives contain classes with the same fully qualified name; see Eclipse’s User Libraries reference.
Rank #3
Restore the JRE System Library
If basic Java types such as java.lang.Object or java.util.List cannot be resolved, inspect the project’s JRE System Library. The configured JRE definition supplies the installation location and system libraries used by Java projects.
- Open Window → Preferences → Java → Installed JREs. Add or select the intended JDK or JRE installation.
- Open Project → Properties → Java Build Path → Libraries.
- Remove the broken JRE System Library, then choose Add Library → JRE System Library.
- Select the workspace default or the project-specific installed runtime, apply the change, and clean and rebuild.
Eclipse documents JRE configuration in its Installed JREs help. Check that the installed JDK, Eclipse compiler compliance level, and any Maven or Gradle source, target, or toolchain settings agree with the project’s requirements. A newer JDK is not automatically a transparent replacement for the version a project expects.
For Maven and Gradle, repair the build file first
When a project has a Maven or Gradle build file, treat that file as the dependency authority. Eclipse displays a model of the build tool’s dependencies; its generated classpath entries may be containers, not a hand-maintained list of JARs. Direct edits to Java Build Path can be overwritten during refresh.
Free tools Windows power users keep installed
One-click scans. No signup required.
Maven
Confirm the dependency is declared in pom.xml and uses the appropriate scope. In broad terms, compile is available for main compilation, provided is expected from another environment at runtime, runtime is for runtime use, and test is limited to tests. The correct scope depends on how the application is built and deployed.
Rank #4
Save the POM and use the Maven project refresh or update command provided by the installed Eclipse Maven integration; exact labels can differ by distribution and m2e version. Then inspect the Maven dependency container on the Libraries tab. If the dependency still fails, run the project’s Maven wrapper, if present, or Maven itself, for example ./mvnw clean verify or mvn clean verify. On Windows, a wrapper is typically invoked as mvnw.cmd clean verify. These commands help distinguish dependency-resolution or build-file problems from Eclipse model problems; they do not necessarily repair Eclipse metadata by themselves.
Gradle
Declare the dependency in the appropriate build.gradle, build.gradle.kts, or convention/dependency file. Configurations such as implementation, api, compileOnly, runtimeOnly, and testImplementation serve different visibility and lifecycle needs; do not choose one solely to make an error disappear.
Save the build script, then right-click the project and choose Gradle → Refresh Gradle Project if Buildship is installed. Eclipse’s Buildship overview describes refresh as the synchronization step after build configuration changes. If synchronization still fails, run the project wrapper from the project root—./gradlew clean build, or gradlew.bat clean build on Windows—and inspect the reported dependency-resolution error.
A dependency can be available to main-source compilation but not runtime, or be available at runtime but not test compilation. The right scope or configuration depends on what actually needs the library.
Best Value
Check Classpath versus Modulepath on Java 9 and later
For a modular project, a library on the wrong path can remain unresolved even when the JAR exists. In Project → Properties → Java Build Path → Libraries, inspect whether the entry is on Classpath or Modulepath. Review Module Dependencies and, if the project has a module-info.java, confirm it declares the required module with an appropriate requires module.name; directive.
Module errors include messages such as “module cannot be resolved,” “package is not accessible,” or a package being declared in a module that is not in the module graph. The module name may not match a JAR’s filename, especially for automatic modules. A legacy JAR can work on the traditional classpath but behave differently on the modulepath. Do not move every library to the modulepath: a non-modular project may need the classpath and unnamed-module model. See Eclipse’s documentation on build-path modularity.
Plug-in, web, and runtime-specific cases
Eclipse plug-in projects
For a PDE plug-in, dependencies normally belong in the plug-in manifest and must be present in the target platform. Check MANIFEST.MF and the target platform, then use PDE’s Tools → Update Classpath where appropriate. Adding an arbitrary external JAR may bypass the bundle model without making the dependency available to the OSGi runtime. Eclipse’s PDE classpath FAQ recommends letting plug-in development tools manage the build path.
PC Slower Than It Used to Be?
A free scan shows the junk files, broken settings and background clutter dragging Windows down - then fixes them in one click.Free scan · Windows 10 & 11Crashes, No Sound, or Screen Glitches?
Random freezes, missing sound and display glitches usually trace back to one bad driver. Find and replace yours safely.Free scan · under a minuteWeb applications and launch configurations
A successful compile does not prove that the application can run. The Java launch configuration has its own classpath. A web project may also need the dependency included in deployment packaging, such as WEB-INF/lib, unless the selected application server supplies it. A dependency marked provided can be correct for compilation but should not necessarily be packaged. The server and project type determine the deployment rules.
If compilation succeeds but launch fails with ClassNotFoundException or NoClassDefFoundError, inspect the launch configuration’s Classpath tab and the project’s deployment assembly or server configuration. Plug-in projects require the bundle to resolve in the target/runtime platform. A JAR that uses native code may also need a native-library location configured on its build-path entry. Compile-time, launch-time, deployment, plug-in, and native-library paths are related but not interchangeable; Eclipse’s discussion of build-time and runtime libraries explains why a project can compile while lacking a library at runtime.
If the error persists
- The JAR exists but is still marked missing: Check for an old drive or folder path, a renamed file, inaccessible permissions, an undefined variable, or a JAR inside a closed or unimported project.
- The marker disappears but imports still fail: Confirm the JAR contains the needed classes and is the right version; the replacement may be the wrong artifact.
- The error returns after refreshing: The classpath is probably generated or managed. Fix Maven, Gradle, or PDE configuration rather than repeatedly editing the generated view.
- Only tests fail: Check the test source set and whether the dependency is test-only. Eclipse supports test-only visibility for relevant build-path entries.
- Only source browsing fails: A missing source attachment is different from a missing required library. Source attachment, Javadoc, annotations, and native-library locations are separate library attributes.
- Several versions of a library are present: Remove unintended duplicates and verify order and export settings rather than adding more JARs.
Editing .classpath directly is best reserved for deliberate automation or advanced recovery. For ordinary repairs, use Java Build Path so Eclipse can validate and update the entry consistently.
Quick Recap
Verify the fix and prevent a repeat
- Run Project → Clean and let Eclipse rebuild.
- Confirm the relevant errors are gone from the Problems view and that imports resolve.
- Run the project’s tests and launch or package it. Verify the runtime or deployment path separately from compilation.
- For shared projects, keep one authoritative dependency source. Prefer Maven or Gradle for reproducible dependencies; if a plain project must use local libraries, avoid absolute paths where possible and document required variables or workspace setup.
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.
Quick wins for a faster PC:
Clear out junk files and repair common Windows errorsFree Scan →Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →

