[Logo]
Forums Register Login
Eclipse, Maven & JDK 1.8.X
Hi folks,

I've been using Eclipse for a while and have had a working Maven integration for about the same time. Up until recently all of my work had been using JDK 1.7. Whenever I ran Maven Builds on my Eclipse projects they ran fine.

I've now had JDK 1.8.0_77 installed (I work for a company who restrict installation rights and as a consequence I'm not free to just install new JDK versions whenever or wherever I want). I've added this new JDK as the Workspace Default in Eclipse. I've confirmed that this is the JDK that I've installed and not the JRE.

The problem I have now is that whenever I run a Maven Build (clean install in my case) on any project that uses JDK 1.8.0_77 as the JRE System Library I receive the following error.




I've researched this and most of the solutions seem to say that deleting the local .m2 repository and rebuilding or updating the project will resolve the issue but I've tried this with no success. For some reason my instance of Eclipse seems to think that my installation of JDK1.8.0_77 is in fact a JRE.

To ensure that it's not a problem with my embedded Maven instance I switched the project's platform dependency back to JDK1.7.X and it installed fine.

Any suggestions on what I can do here?
Simon,
What version of Eclipse?

Also, can you check the effective pom to see where it is looking for Java?
Hi Jeanne,

It's Eclipse Luna Service Release 2 (4.4.2)

The effective POM doesn't specify where it's searching for Java:

Can you please add JDK in System Variables and check whether it is working ?
My JAVA_HOME environment variable in Windows: 

echo %JAVA_HOME%
C:\Program Files\Java\jdk1.8.0_77

My M2_HOME environment variable in Windows: 

echo %M2_HOME%
C:\Java\apache-maven-3.3.9

My MAVEN_HOME environment variable in Windows: 

echo %MAVEN_HOME%
C:\Java\apache-maven-3.3.9

I've updated my version of Eclipse to Mars.2 Release (4.5.2) but the error persists.  It seems to think my installed version of JDK 1.8.X is a JRE.
It seems the issue isn't just restricted to my IDE.  I've tried running a mvn clean install from the command prompt and I get the same error.  I'll open a question in the Maven forum, if that's okay?
 

Simon Ritchie wrote:It seems the issue isn't just restricted to my IDE.  I've tried running a mvn clean install from the command prompt and I get the same error.  I'll open a question in the Maven forum, if that's okay?


As a mod, I can add the same thread to be linked from multiple forums so did that for you.
I think the issue is your PATH. Does this work?


If not, your "JDK" install is corrupt and you should re-install. If it does work, type "path" and see what is on the path that is a JRE and remove that. Or post the PATH here.




Hi Jeanne,

The issue seems to be with a corrupt installation of JDK1.8.0_77 (as helpfully pointed out here) so the problem isn't just localised to my instance of Eclipse.  I'm on a work PC so I've had to request a new version of 1.8.0_77 to be installed. 

(Sorry to open another topic but once I realised it wasn't just affecting Eclipse but my Maven and Java installs too I thought I should raise the question on the Maven forum here).
No problem. Adding a link to the new thread so it is obvious this isn't the latest anymore.
Wink, wink, nudge, nudge, say no more ... https://richsoil.com/cards


This thread has been viewed 1774 times.

All times above are in ranch (not your local) time.
The current ranch time is
Jun 24, 2018 20:40:22.