简体   繁体   English

要求在windows7中设置JRE路径,例如设置JDK的路径

[英]Requirement for setting JRE path in windows7, like setting path for JDK

Should I have to add/set the path for JRE as well like I did for JDK 1.7? 我是否应该为JRE添加/设置路径,就像我为JDK 1.7所做的那样? If yes, then please explain how. 如果是,那么请解释如何。 If no then why it is not necessary. 如果不是那么为什么没有必要。 (I am using windows 7, 64 bit) (我使用的是Windows 7,64位)

Thank you. 谢谢。

The "JDK" is the Java Development Kit. “JDK”是Java Development Kit。 Ie, the JDK is bundle of software that you can use to develop Java based software. 即,JDK是可用于开发基于Java的软件的软件包。

The "JRE" is the Java Runtime Environment. “JRE”是Java运行时环境。 Ie, the JRE is an implementation of the Java Virtual Machine which actually executes Java programs. 即,JRE是实际执行Java程序的Java虚拟机的实现。 Without JRE one can only compile the application but cannot run the application. 没有JRE,只能编译应用程序,但无法运行应用程序。

Since JRE contains the JVM which executes the byte code generated from the javac compiler, you need to add your JRE path to JAVA_HOME variable from the environment variables. 由于JRE包含执行从javac编译器生成的字节代码的JVM,因此需要将JRE路径添加到环境变量中的JAVA_HOME变量中。 Here's the tutorial for doing so: http://java.com/en/download/help/path.xml 以下是这样做的教程: http//java.com/en/download/help/path.xml

Technically, the JDK contains the JRE, so if you have set your PATH properly you shouldn't need a separate entry for the JRE. 从技术上讲,JDK包含JRE,因此如果您正确设置了PATH,则不需要为JRE单独输入。

Think of it this way - the JRE contains everything you need to run a Java program. 可以这样想 - JRE包含运行Java程序所需的一切。 The JDK contains everything you need to run AND develop the program. JDK包含运行和开发程序所需的一切。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM