• Post Reply Bookmark Topic Watch Topic
  • New Topic

Eclipse, Maven & JDK 1.8.X  RSS feed

 
Simon Ritchie
Ranch Hand
Posts: 134
4
Eclipse IDE Hibernate Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 37513
554
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Simon,
What version of Eclipse?

Also, can you check the effective pom to see where it is looking for Java?
 
Simon Ritchie
Ranch Hand
Posts: 134
4
Eclipse IDE Hibernate Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Jeanne,

It's Eclipse Luna Service Release 2 (4.4.2)

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

 
S Ry
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you please add JDK in System Variables and check whether it is working ?
 
Simon Ritchie
Ranch Hand
Posts: 134
4
Eclipse IDE Hibernate Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Simon Ritchie
Ranch Hand
Posts: 134
4
Eclipse IDE Hibernate Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 37513
554
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 37513
554
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.




 
Simon Ritchie
Ranch Hand
Posts: 134
4
Eclipse IDE Hibernate Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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).
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 37513
554
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No problem. Adding a link to the new thread so it is obvious this isn't the latest anymore.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!