Maven can't find tools.jar

Viewed 8520

I am working on a Spring STS project using Eclipse and when I try to run my unit tests using Run as > Maven test I have the following error:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.5.1:compile (default-compile)
        on project eshop-sample-spring-legacy: Fatal error compiling: tools.jar not found: 
        C:\Program Files\Java\jre1.8.0_144\..\lib\tools.jar -> [Help 1]

I have Java 8 update 144 installed and my variable environments set as follow:

JAVA_HOME = C:\Program Files\Java\jdk1.8.0_144
JRE_HOME = C:\Program Files\Java\jdk1.8.0_144\jre
Path = ...;C:\Program Files\Java\jdk1.8.0_144\bin;C:\Program Files\Java\jdk1.8.0_144\jre\bin;...

My C:\Program Files\Java folder contains jdk1.8.0_144 and jre1.8.0_144 installation folders.

In Eclipse I set Windows > Preferences > Java > Installed JREs pointing to C:\Program Files\Java\jdk1.8.0_144\jre.

Can somebody help me? Thanks

2 Answers
Related