The JRE is the Java Runtime Environment .
(JRE是Java运行时环境 。)
It is a package of everything necessary to run a compiled Java program, including the Java Virtual Machine (JVM), the Java Class Library, the java
command, and other infrastructure. (它是运行已编译的Java程序所需的所有程序的包,包括Java虚拟机(JVM),Java类库, java
命令和其他基础结构。)
However, it cannot be used to create new programs. (但是,它不能用于创建新程序。)
The JDK is the Java Development Kit , the full-featured SDK for Java.
(JDK是Java Development Kit ,这是Java的全功能SDK。)
It has everything the JRE has, but also the compiler ( javac
) and tools (like javadoc
and jdb
). (它具有JRE拥有的所有内容,还具有编译器( javac
)和工具(如javadoc
和jdb
)。)
It is capable of creating and compiling programs. (它能够创建和编译程序。)
Usually, if you only care about running Java programs on computer you will only install the JRE.
(通常,如果只关心在计算机上运行Java程序,则只会安装JRE。)
It's all you need. (这就是您所需要的。)
On the other hand, if you are planning to do some Java programming, you need to install the JDK instead. (另一方面,如果您打算进行一些Java编程,则需要安装JDK。)
Sometimes, even if you are not planning to do any Java development on a computer, you still need the JDK installed.
(有时,即使您不打算在计算机上进行任何Java开发,也仍然需要安装JDK。)
For example, if you are deploying a web application with JSP, you are technically just running Java programs inside the application server. (例如,如果要使用JSP部署Web应用程序,则从技术上讲,您只是在应用程序服务器内部运行Java程序。)
Why would you need the JDK then? (那为什么还要JDK呢?)
Because the application server will convert JSP into Java servlets and needs to use the JDK to compile the servlets. (因为应用服务器会将JSP转换为Java servlet,并且需要使用JDK来编译servlet。)
I am sure there are be more examples. (我相信还有更多的例子。)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…