问题
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...
- Eclipse is packaged with a JDK (if this is true, I can't find the JDK on my computer)
- 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