HotSpot And OpenJDK

1. HotSpot

HotSpot是JVM(Java Virtual Machine),是一个运行Java字节码的虚拟机。

HotSpot包括:

  • 一个Java ClassLoader

  • 一个Java字节码解释器

  • Client和Server模式的虚拟机,针对不同用途做优化

  • 一些垃圾回收器

  • 一组运行时库

为什么叫HotSpot?

因为这款虚拟机当时就是为了性能而打造,会分析程序执行的热点(hot spots),将这些热点即时编译以优化性能,固取名HotSpot

PS:

  • 2007年Sun估算了下HotSpot大约有250,000行代码

  • 2006年11月13日,HotSpot JVM和JDK开始使用GPLV2许可证,随后加入到了Java 7中

  • HotSpot是用C++写的

2. JDK

JDK(Java Development Kit),Java开发工具集,是Java SE、Java EE、Java ME的一种实现(为毛Java要搞这么多平台),以二进制应用形式发布,包含一个JVM和「其他开发Java应用程序所需的东西」,其他东西到底是啥,得说清楚啊,列个表

  • appletviewer – this tool can be used to run and debug Java applets without a web browser

  • apt – the annotation-processing tool[4]

  • extcheck – a utility that detects JAR file conflicts

  • idlj – the IDL-to-Java compiler. This utility generates Java bindings from a given Java IDL file.

  • jabswitch – the Java Access Bridge. Exposes assistive technologies on Microsoft Windows systems.

  • java – the loader for Java applications. This tool is an interpreter and can interpret the class files generated by the javac compiler. Now a single launcher is used for both development and deployment. The old deployment launcher, jre, no longer comes with Sun JDK, and instead it has been replaced by this new java loader.

  • javac – the Java compiler, which converts source code into Java bytecode

  • javadoc – the documentation generator, which automatically generates documentation from source code comments

  • jar – the archiver, which packages related class libraries into a single JAR file. This tool also helps manage JAR files.

  • javafxpackager – tool to package and sign JavaFX applications

  • jarsigner – the jar signing and verification tool

  • javah – the C header and stub generator, used to write native methods

  • javap – the class file disassembler

  • javaws – the Java Web Start launcher for JNLP applications

  • JConsole – Java Monitoring and Management Console

  • jdb – the debugger

  • jhat – Java Heap Analysis Tool (experimental)

  • jinfo – This utility gets configuration information from a running Java process or crash dump. (experimental)

  • jmap Oracle jmap - Memory Map– This utility outputs the memory map for Java and can print shared object memory maps or heap memory details of a given process or core dump. (experimental)

  • jmc – Java Mission Control

  • jps – Java Virtual Machine Process Status Tool lists the instrumented HotSpot Java Virtual Machines (JVMs) on the target system. (experimental)

  • jrunscript – Java command-line script shell.

  • jstack – utility that prints Java stack traces of Java threads (experimental)

  • jstat – Java Virtual Machine statistics monitoring tool (experimental)

  • jstatd – jstat daemon (experimental)

  • keytool – tool for manipulating the keystore

  • pack200 – JAR compression tool

  • policytool – the policy creation and management tool, which can determine policy for a Java runtime, specifying which permissions are available for code from various sources.

  • VisualVM – visual tool integrating several command-line JDK tools and lightweight[clarification needed] performance and memory profiling capabilities

  • wsimport – generates portable JAX-WS artifacts for invoking a web service.

  • xjc – Part of the Java API for XML Binding (JAXB) API. It accepts an XML schema and generates Java classes.

再说回来为毛Java搞这么多平台呢?估计是不同场景下的开发所需的API大不相同,全整合到一起又嫌大,所以分不同场景搞了多个平台吧,我猜的

3. JRE

Java运行时环境,顾名思义就是指运行java程序所需要的环境,那么运行Java程序的最小集合就是JRE了,显然包含一个JVM,再加上一些Java类库就可以了,其他东西都不需要。在这个基础上再加上一些编译调试工具啥的(比如javac, jstack工具)就是上面说的JDK了。所以如果你只是要运行Java程序,有JRE就可以了,但如果要开发Java程序,就得有JDK

4. OpenJDK

Open Java Development Kit是Java SE的开源免费实现。Sun公司在JavaOne 2006会议上宣布将开源Java,随后在2006年11月13日Sun以GPL许可发布了HotSpot以及编译器,并承诺JDK剩余的部分将会在2007年5月以GPL发布,"除开一些Sun无权以GPL许可发布源码的组件之外"。2007年5月8日,Sun以GPL许可发布了Java类库的源码,除开一些第三方授权给Sun的受限的部分,如Java图形用户接口等。Sun决定接下来要替换掉这些受到专利保护的部分,从而使Java类库完全免费。2007年5月,OpenJDK类库有4%的部分有专利保护。2008年5月发布的OpenJDK 6,只剩下不到1%的部分(SNMP的实现,非Java规范的部分)。到2009年4月OpenJDK 7发布时,所有专利保护部分终于全部去除。

5. 参考资料

https://en.wikipedia.org/wiki/HotSpot

https://en.wikipedia.org/wiki/Java_Development_Kit

https://en.wikipedia.org/wiki/Java_virtual_machine#Java_Runtime_Environment_from_Oracle

猜你喜欢

转载自blog.csdn.net/xiaocszn/article/details/81709061
今日推荐