Why doesn't Eclipse need me to configure a JDK?

强颜欢笑 提交于 2019-12-22 11:37:07

问题


I recently downloaded Eclipse onto a Windows 7 machine. The machine already had a JRE but I noticed it didn't have a JDK. I was afraid I would have to download the JDK and then hook Eclipse up to it. I was (pleasanly) surprised when I was able to code, compile and run in Eclipse right out of the box. However, now I'm confused. From what I know about Java, Eclipse should need a JDK to compile code and a JRE to execute it.

The best I can think of is...

  1. Eclipse is packaged with a JDK (if this is true, I can't find the JDK on my computer)
  2. I'm way out in left field and don't understand JDKs as well as I thought I did.

Admittedly more of a curiosity question, why am I able to compile java without a JDK?


回答1:


Eclipse has an internal compiler for some time now. Several years ago it needed a JDK but for now a JRE will suffice.

However if you want to browse or debug in the Java source code, a JDK is better.



来源:https://stackoverflow.com/questions/16863657/why-doesnt-eclipse-need-me-to-configure-a-jdk

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!