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

September 21, 2018

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…


Similar Posts

Latest Posts