• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Eclipse, Maven & JDK 1.8.X

 
Ranch Hand
Posts: 193
14
Hibernate Eclipse IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
author & internet detective
Posts: 41860
908
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 193
14
Hibernate Eclipse IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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:

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can you please add JDK in System Variables and check whether it is working ?
 
Simon Ritchie
Ranch Hand
Posts: 193
14
Hibernate Eclipse IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 193
14
Hibernate Eclipse IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 41860
908
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 41860
908
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 193
14
Hibernate Eclipse IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 41860
908
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
No problem. Adding a link to the new thread so it is obvious this isn't the latest anymore.
 
reply
    Bookmark Topic Watch Topic
  • New Topic