tutorials1 Min Read

Eclipse/STS IDE showing compilation errors in java code inspite of all dependencies installed

Gorav Singal

September 21, 2018

TL;DR

Install Maven manually, update project settings in Eclipse/STS, and clean the project to resolve false compilation errors when all dependencies are correctly downloaded.

Eclipse/STS IDE showing compilation errors in java code inspite of all dependencies installed

I have a Java project and dependencies are being managed through maven. I have installed all dependencies, and each library successfully downloaded, installed. Still, editor showing compilation error in red colors. This is annoying.

Install Maven manually

So, if you installed STS, a default maven installation comes with the package of STS. Which is sufficient. But, sometimes you need to run mvn commands on terminal.

You should install maven manually. I’m on MAC. I installed maven through brew,

brew install maven

Add maven installation in Eclipse or STS

Now, I have to tell STS about my maven installation.

  • Goto its preferences/settings
  • Click on installations

STS Maven settings

You can see some installed maven configurations on right side.

Configure new maven installation in STS

Click on add. It will ask for new installation path. My installation path was:

/usr/local/Cellar/maven/3.5.3/

On giving this path, STS gives me error:

target is not a supported maven home

The trick is to give path till libexec folder. So, the complete path is:

/usr/local/Cellar/maven/3.5.3/libexec

Thanks for reading…

Share

Related Posts

Java - Union and Intersection of two lists

Java - Union and Intersection of two lists

Suppose you have two lists, and you want Union and Intersection of those two…

Linkage Error Loader Constraint Violation - JUnit test case development issue

Linkage Error Loader Constraint Violation - JUnit test case development issue

Its good to write unit tests cases, and this part is mostly forgotten by…

How to mock a constructor - Junit test case development issues

How to mock a constructor - Junit test case development issues

While writing JUnit test cases, we encounter cases like we want to initialize a…

Java Log4j Logger - Programmatically Initialize JSON logger with customized keys in json logs

Java Log4j Logger - Programmatically Initialize JSON logger with customized keys in json logs

Introduction Java log4j has many ways to initialize and append the desired…

How to Solve Spring Okta/Saml issue of SAML message intended destination endpoint did not match the recipient endpoint

How to Solve Spring Okta/Saml issue of SAML message intended destination endpoint did not match the recipient endpoint

Introduction I was trying to integrate Okta with Spring, and when I deploy the…

Spring - Learn Multiple Ways to use PackageScan Annotation

Spring - Learn Multiple Ways to use PackageScan Annotation

Introduction In this post, we will see multiple ways to use annotation…

Latest Posts

AI Video Generation in 2025 — Models, Costs, and How to Build a Cost-Effective Pipeline

AI Video Generation in 2025 — Models, Costs, and How to Build a Cost-Effective Pipeline

AI video generation went from “cool demo” to “usable in production” in 2024-202…

AI Models in 2025 — Cost, Capabilities, and Which One to Use

AI Models in 2025 — Cost, Capabilities, and Which One to Use

Choosing the right AI model is one of the most impactful decisions you’ll make…

AI Image Generation in 2025 — Models, Costs, and How to Optimize Spend

AI Image Generation in 2025 — Models, Costs, and How to Optimize Spend

Generating one image with AI costs between $0.002 and $0.12. That might sound…

AI Coding Assistants in 2025 — Every Tool Compared, and Which One to Actually Use

AI Coding Assistants in 2025 — Every Tool Compared, and Which One to Actually Use

Two years ago, AI coding meant one thing: GitHub Copilot autocompleting your…

AI Agents Demystified — It's Just Automation With a Better Brain

AI Agents Demystified — It's Just Automation With a Better Brain

Let’s cut through the noise. If you read Twitter or LinkedIn, you’d think “AI…

Supply Chain Security — Protecting Your Software Pipeline

Supply Chain Security — Protecting Your Software Pipeline

In 2024, a single malicious contributor nearly compromised every Linux system on…