~/tutorials/eclipse-sts-showing-compilation-errors-ide.md

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

1 min readSeptember 21, 2018by Gorav Singal#eclipse#java#maven
// 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…

$ subscribe --weekly

One deep dive a week, in your inbox

System design, AI engineering, trading systems and interview prep. Tested code, real numbers. Free, and you can unsubscribe any time.

or read it on gyanbyte.substack.com

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…

Fix: SAML Message Intended Destination Did Not Match Recipient

Fix: SAML Message Intended Destination Did Not Match Recipient

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

How to Stay Valuable as a Software Engineer in the AI Era: A Practical Playbook

How to Stay Valuable as a Software Engineer in the AI Era: A Practical Playbook

In the previous article I argued that AI is not killing software engineering…

How to Review AI-Generated Code: A Checklist for Catching What the Model Missed

How to Review AI-Generated Code: A Checklist for Catching What the Model Missed

A few months back I approved a PR that was almost entirely AI-generated. It…

How to Debug AI-Generated Code: Understand First, Fix Last

How to Debug AI-Generated Code: Understand First, Fix Last

In the last article I wrote about reviewing AI code before it goes in. This one…

The Future of Software Engineering: What AI Changes, What Stays, and Where the Jobs Go

The Future of Software Engineering: What AI Changes, What Stays, and Where the Jobs Go

Every few weeks somebody sends me a scary headline — “AI will replace all…

The Transactional Outbox Pattern: Never Lose an Event Again

The Transactional Outbox Pattern: Never Lose an Event Again

This is one of those patterns that looks like nothing until you get burnt once…

Event Sourcing, Explained: Store What Happened, Not Just the Final State

Event Sourcing, Explained: Store What Happened, Not Just the Final State

Here is a question I like to ask in interviews: your bank account shows a…