简体   繁体   中英

JRE included with JDK vs. standalone JRE

What's the difference between the JRE included with the JDK (located inside of the jre folder) and the standalone JRE? Is there any?

The "standalone JRE" (sometimes also referred to as the "Public JRE") generally does not contain the server version of HotSpot. It also lacks the tools included with the JDK (JavaDB, javac, tools.jar, etc).

Otherwise, the runtimes are identical. Also, note that a JDK may install one (or more) JREs.

Finally, all of the above notes are in regards to Sun's Java installers for Windows. Other vendors and platforms may (and sometimes do) vary.

There is no difference (unless you have a different version of the JRE). Here is the official definition from SUN/Oracle:

http://java.sun.com/javase/6/docs/technotes/guides/index.html

JRE and JDK Sun Microsystems provides two principal software products in the JavaTM Platform, Standard Edition (JavaTM SE) family:

Java SE Runtime Environment (JRE)

The JRE provides the libraries, Java virtual machine, and other components necessary for you to run applets and applications written in the Java programming language. This runtime environment can be redistributed with applications to make them free-standing.

Java SE Development Kit (JDK)

The JDK includes the JRE plus command-line development tools such as compilers and debuggers that are necessary or useful for developing applets and applications.

If you run a binary compare against the standalone JRE and the JRE included in the JDK they are binary different (at least in Windows version).

The class count in rt.jar is equal but out of curiosity, I ran 'javap' on all classes in both and compared results.

The only difference I see is that the JDK verison has lines like 'Compiled from "Serializable.java' before the class code.

I don't think this should have any impact on end user, so these JREs should be in fact behaving the same way.

The difference is legal. JDK is for development, JRE is for execution. You can include JRE with a product

The "JDK" is the Java Development Kit. The JDK is bundle of software that you can use to develop Java based software. The "JRE" is the Java Runtime Environment. The JRE is an implementation of the Java Virtual Machine which actually executes Java programs.

Typically, each JDK contains one (or more) JRE's along with the various development tools like the Java source compilers, bundling and deployment tools, debuggers, development libraries, etc.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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