Skip to main content



      Home
Home » Language IDEs » Java Development Tools (JDT) » Why does Eclipse specify JRE rather than JDK(A question about Eclipse Java behavior)
icon5.gif  Why does Eclipse specify JRE rather than JDK [message #1697558] Thu, 04 June 2015 17:14 Go to next message
Eclipse UserFriend
I recently had to resolve a problem where Eclipse was pointing to the latest jrel1.8.0_45. I resolved by going to Window=>preference=>Java=>Installed JREs and adding my older jdk1.7.0_75. After fixing this I ran into a couple of questions that someone on these forums might be able to answer.

1. jrel1.8.0_45 had been on my system for about a month and a half and I had created eight Java projects with this being the system library that was in the build path. These were working as far as I could tell.

Can someone tell me how having a jre as the system library can allow my applications compile and run?

2. I did not have a problem until one of my projects needed to use a HashMap. At that point I received the following error:

"The project was not built since its build path is incomplete. Cannot find the class file for java.util.Map$Entry. Fix the build path then try building this project"

Now it didn't complain about HashMap. I expected that if it found HashMap it should find Map$Entry. The error showed up on the very first line of code in the program as the red error icon, i.e., on the package statement.

I also don't see an error on a previous project where I use a HashSet.

Does anyone know why I would see this kind of error only after trying to use a HashMap?

I appreciate anyone's insight.

Thanks

Shaun Montgomery
Re: Why does Eclipse specify JRE rather than JDK [message #1697661 is a reply to message #1697558] Fri, 05 June 2015 15:00 Go to previous messageGo to next message
Eclipse UserFriend
1. Eclipse has it's own compiler. That's one of the Java Development Tools (JDT) for which this forum is named. Smile So you don't need a JDK to develop java software in Eclipse, you just need the JRE.

2. You got me. There seems to have been a problem with the project's classpath. (Speculating.) And it was resolved, incidentally, when you changed from the jre to the old jdk. (Speculating wildly.) Perhaps someone else has more insight into this part.
Re: Why does Eclipse specify JRE rather than JDK [message #1697684 is a reply to message #1697661] Fri, 05 June 2015 18:54 Go to previous messageGo to next message
Eclipse UserFriend
ad 2.: What version Eclipse are you using? You aren't by any chance running into this: http://stackoverflow.com/questions/26700824/jdk-8-the-type-java-util-mapentry-cannot-be-resolved ?
Re: Why does Eclipse specify JRE rather than JDK [message #1697686 is a reply to message #1697684] Fri, 05 June 2015 18:58 Go to previous messageGo to next message
Eclipse UserFriend
No Message Body
Re: Why does Eclipse specify JRE rather than JDK [message #1697687 is a reply to message #1697686] Fri, 05 June 2015 19:02 Go to previous messageGo to next message
Eclipse UserFriend
Thanks Guys,

Stephan Herrmann has it right, I had a problem using Indigo and I made it point to JDK 1.7 and the problem went away. That was exactly the post that helped me solve the problem. I should upgrade to Luna and go back to 1.8.

Erick Hagstrom somewhat explained why Eclipse refers to JRE everywhere. I hadn't remembered that the JDT has its own compiler so it only needs the JRE. Weird that it complains about Map$Entry but not Map or HashMap. If I get a chance I'll look into that further and post here.
Re: Why does Eclipse specify JRE rather than JDK [message #1697688 is a reply to message #1697687] Fri, 05 June 2015 19:09 Go to previous messageGo to next message
Eclipse UserFriend
Quote:
Weird that it complains about Map$Entry but not Map or HashMap. If I get a chance I'll look into that further and post here.
The SO thread links to a duplicate which has the explanation in its answer, look for "Map.Entry, an interface which now has static methods." Smile
Re: Why does Eclipse specify JRE rather than JDK [message #1697705 is a reply to message #1697688] Sat, 06 June 2015 13:52 Go to previous message
Eclipse UserFriend
Good catch Stephan. Smile
Previous Topic:Getting java.net.SocketException: SSL implementation not available
Next Topic:SDK android
Goto Forum:
  


Current Time: Tue Apr 22 16:43:46 EDT 2025

Powered by FUDForum. Page generated in 0.05256 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top