The cornerstone of Java development: JDK



foreword

This blogger will use CSDN to record the experience and knowledge he has personally gained and learned on the way to study software development. Interested friends can pay attention to the blogger! Perhaps a person can go fast alone, but a group of people can go farther!

1. Introduction

JDK is the abbreviation of Java Development Kit, which is the core component of Java development tools. JDK contains the Java compiler, Java runtime environment, Java API class library and other tools for developing, compiling, running and debugging Java applications. JDK is the foundation of Java development and one of the tools that Java programmers must master.

2. The development history of JDK

There are many versions of JDK, each version has its own features and functions. Currently, the latest stable version is JDK 17, while the most widely used version is JDK 8. The following is the version history of the JDK:

  1. JDK 1.0: The first version of Java, released in January 1996.
  2. JDK 1.1: Released in February 1997, adding functions such as internal classes, JavaBean, RMI, etc.
  3. JDK 1.2: Released in December 1998, introducing the Swing, Java 2D, and JavaBeans component architectures.
  4. JDK 1.3: Released in May 2000, adding features such as Java Sound, Java Naming and Directory Interface (JNDI) and Java Platform Debugger Architecture (JPDA).
  5. JDK 1.4: Released in February 2002, adding Java Web Start, Java Management Extensions (JMX) and Java Native Interface (JNI) extensions.
  6. JDK 5: Released in September 2004, adding features such as autoboxing, generics, enumerations, and annotations of the Java language.
  7. JDK 6: Released in December 2006, enhanced functions such as JDBC, Java Web Services and Java Compiler API.
  8. JDK 7: Released in July 2011, introducing new language features, NIO 2.0, and Fork/Join Framework.
  9. JDK 8: Released in March 2014, new features such as Lambda expressions, Stream API, and Date Time API were added.
  10. JDK 9: Released in September 2017, adding new features such as modularity, REPL, and HTTP/2 support.
  11. JDK 10: Released in March 2018, adding new features such as local variable type inference, application class data sharing, and garbage collector interface.
  12. JDK 11: Released in September 2018, new features such as HTTP Client API, ZGC garbage collector and Epsilon garbage collector were added.
  13. JDK 12-16: Released between March 2019 and March 2021, introducing new language features, JVM features, garbage collectors, and more.
  14. JDK 17: Released in September 2021, adding new features such as the Sealed class, Pattern Matching for switch, Vector API, and Foreign Function and Memory API.

Why did the naming format change so much from JDK1.4 to JDK5?
The main reason why the JDK naming changed from 1.4 to 5 is that the JDK5 version introduced many new features and great changes have taken place. In order to better reflect the development and progress of Java technology, the Java version number is displayed in a more intuitive way.

Three, JDK main directory structure analysis

In JDK 8, the main directory structure of JDK is as follows:

jdk1.8.0/
├── bin/
│   ├── appletviewer
│   ├── extcheck
│   ├── idlj
│   ├── jar
│   ├── jarsigner
│   ├── java
│   ├── javac
│   ├── javadoc
│   ├── javafxpackager
│   ├── javah
│   ├── javap
│   ├── java-rmi.cgi
│   ├── javaws
│   ├── jcmd
│   ├── jconsole
│   ├── jdb
│   ├── jinfo
│   ├── jmap
│   ├── jps
│   ├── jrunscript
│   ├── jsadebugd
│   ├── jstack
│   ├── jstat
│   ├── jstatd
│   ├── keytool
│   ├── native2ascii
│   ├── orbd
│   ├── pack200
│   ├── policytool
│   ├── rmic
│   ├── rmid
│   ├── rmiregistry
│   ├── schemagen
│   ├── serialver
│   ├── servertool
│   ├── tnameserv
│   ├── unpack200
│   └── wsgen
├── include/
│   └── *.h
├── jre/
│   ├── bin/
│   ├── lib/
│   ├── plugin/
│   ├── COPYRIGHT
│   ├── LICENSE
│   ├── README
│   └── THIRDPARTYLICENSEREADME.txt
├── lib/
│   ├── tools.jar
│   ├── dt.jar
│   ├── jconsole.jar
│   ├── missioncontrol
│   ├── visualvm
│   ├── ant-javafx.jar
│   ├── ant-junit.jar
│   ├── ant-launcher.jar
│   ├── ant.jar
│   ├── jfxswt.jar
│   ├── javafx-mx.jar
│   ├── jfr
│   ├── jfr.jar
│   ├── jfxrt.jar
│   └── management-agent.jar
├── src.zip
├── COPYRIGHT
├── LICENSE
└── README.html

Here's what these directories do:

  1. bin/: This directory contains the core tools and utilities necessary for Java development and execution. These include tools javacfor compiling Java source code, javafor running Java applications, jarfor creating and manipulating Java archives, and more. There are other tools for troubleshooting and debugging, such as jconsole, jvisualvm, jstacketc.

  2. include/: This directory contains the C header files needed to develop native extensions using the Java Native Interface (JNI). JNI is a programming framework that allows Java applications to call native code written in C or C++.

  3. jre/: This directory contains the Java Runtime Environment (JRE), which is used to run Java applications. The JRE includes the Java Virtual Machine (JVM), class libraries, and other files needed to run Java applications. jre/bin/The directory contains the executables used to start the JRE, such as java, , javawand javaws.

  4. lib/: This directory contains Java libraries and tools, such as tools.jar, jfxswt.jar, and jfxrt.jarso on. These files are commonly used to develop Java applications. Among them tools.jaris the core library required to develop Java applications, which contains the Java compiler ( javac) and other development tools. jfxswt.jarand jfxrt.jarare part of the JavaFX library for developing rich client applications.

  5. src.zip: This file is the source code compression package of JDK, which contains the source code of Java development tools and libraries. These source codes can be used to learn the internal implementation and debugging of JDK.

  6. COPYRIGHT: This file contains the copyright notice of the JDK.

  7. LICENSE: This file contains the JDK license.

  8. README.html: This file contains the basic information and usage instructions of the JDK.

These directories contain the tools, libraries, files, and source code necessary for Java development and execution. Among them, bin/the directory is the most important one, because it contains the core tools of Java, which can be used in the terminal.

Fourth, the use of JDK

  1. To use JDK for Java development, you need to install JDK on your computer and configure Java environment variables (specifically how to install, there are a lot of online tutorials). After installing the JDK, you can use command line tools or an integrated development environment (IDE) for Java development.

  2. On the command line, you can use javac to compile Java source code, generate a bytecode file, and then use the java command to run the bytecode file. For example:

javac HelloWorld.java
java HelloWorld
  1. In the IDE, you can use the code editor, auto-completion, debugger and other functions provided by the IDE to greatly improve the development efficiency and code quality. Common Java IDEs include Eclipse, IntelliJ IDEA, and NetBeans.
  2. In addition to Java development, JDK also provides a wealth of tools and components for performance optimization, debugging and diagnosis. For example, jstat can monitor JVM performance indicators, jmap can generate heap dump files, jdb can debug Java programs, etc.

Guess you like

Origin blog.csdn.net/weixin_52533007/article/details/131991191