Java 我需要JDK和JRE吗?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/32988601/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-11 14:07:56  来源:igfitidea点击:

Do I need both JDK and JRE?

javaeclipse

提问by Chris Daniel

I used to have JRE 7 before, and now I installed JDK 8 and deleted my JRE 7 folder. I'm using Eclipse Kepler, and I added JDK 1.8 to my installed JRE's. Can I delete the JRE 1.8 folder as it's taking up space in my computer? Will it cause any problems?

我以前有 JRE 7,现在我安装了 JDK 8 并删除了我的 JRE 7 文件夹。我正在使用 Eclipse Kepler,并将 JDK 1.8 添加到我安装的 JRE 中。我可以删除 JRE 1.8 文件夹,因为它占用了我的计算机空间吗?它会导致任何问题吗?

回答by Suresh Atta

JRE is a part of JDK.

JRE 是 JDK 的一部分。

No need to have JRE when you have JDK. If you open JDK folder and see, you'll have JRE folder inside it which is the same of JRE folder initially you have.

有了 JDK 就不需要 JRE。如果您打开 JDK 文件夹并查看,您将在其中包含 JRE 文件夹,这与您最初拥有的 JRE 文件夹相同。

回答by Matthias J. Sax

You can delete JRE. JDK is a superset of JRE and contains everything already.

您可以删除 JRE。JDK 是 JRE 的超集,已经包含了所有内容。

回答by Vishal Gajera

As all have said that JDK includes JRE, that is perfectly right.

正如大家所说,JDK 包含 JRE,这是完全正确的。

But let me add more on it to fulfill an industrial Structure.

但是让我添加更多内容以实现工业结构

While an employee works on some project, they need JDK for they need to write code as well as compile it. But after the development process completes, the software is ready to deliver and the client's machine will have to choose whether JDK is needed or the JRE.

当员工在某个项目上工作时,他们需要 JDK,因为他们需要编写代码以及编译它。但是在开发过程完成后,软件就可以交付了,客户的机器将不得不选择是需要 JDK 还是 JRE。

I would recommend to install JRE on clients' machines because clients don't have to compile the code. Clients always goes straight forward to execute it.

我建议在客户端的机器上安装 JRE,因为客户端不必编译代码。客户总是直接执行它。

So, make sure to install JRE on clients' machines, not JDK. It will give the advantage of Memory - Utilizationtoo.

因此,请确保在客户端的机器上安装 JRE,而不是 JDK。它也会带来好处Memory - Utilization

Thanks.

谢谢。