Java JDK、SDK、SE?

2022-01-08 00:00:00 sdk java

如果您能回答这些问题或帮助我清楚一点,将不胜感激:

If you could answer these questions or help me out a little with clarity, it will be greatly appreciated:

  • Java 7 只是 Java SE 7 吗?Java 6 是 Java SE 6 吗?
  • Java SE 7 也是 Java JDK 7 吗?还有JDK是什么?
  • 这是否意味着Java JDK与Java号(Java SE 7)相同?
  • 什么是 java 1.5 和 1.6?以及它与 Java 编号 (Java SE...) 的对应关系如何?
  • Java的SDK和JDK一样吗?

推荐答案

是的,这可能会令人困惑.

Yes, it can be confusing.

你没有要求,但我会从这里开始.JVM 是 Java 虚拟机.它是一个程序,可以读取已编译的 Java 代码(.class 文件和 .jar 文件,这些文件只是包含一堆 .class 文件打包在一起的 .zip 文件)并执行它.JVM 有很多,例如你需要一个用于 Windows 的 JVM,一个用于 Linux,一个用于 OSX 等,但也有许多替代的 JVM,用于嵌入式设备的 JVM 等(很多人会不同意并说 JVM 只是一个,它是一个规范.但是,通常系统管理员会说JVM"来指示服务器上运行的实际二进制文件).

You didn't ask for it, but I'll start from here. The JVM is the Java Virtual Machine. It is a program that can read compiled Java code (the .class files, and the .jar files that are simply .zip files containing a bunch of .class files packaged together) and execute it. There are many JVMs, for example you need a JVM for Windows, one for Linux, one for OSX etc. but there are also many alternative JVMs, JVMs for embedded device etc. (many will disagree and say that the JVM is only one, and it's a specification. However, commonly a sysadmin will say "the JVM" to indicate the actual binary running on the server).

您也没有要求以下内容.JRE 是 Java 运行时环境.它包括运行 Java 应用程序所需的一切,即 JVM 本身、标准库和一堆其他文件.标准库本身就非常重要,因为它包含了许多您在开发 Java 应用程序时会用到的有用的东西.它包含 java.* 包中的所有内容和 com.sun、com.oracle 包中的一些私有内容.

You didn't ask for the following either. The JRE is the Java Runtime Environment. It includes everything needed to run a Java application, that is the JVM itself, the standard library and a bunch of other files. The standard library is itself very important, because it contains a lot of useful things you'll use when developing Java applications. It contains all the stuff in java.* packages and some private stuff in com.sun, com.oracle packages.

Java 的不同版本(1.0、1.1 等一直到 1.7,也称为 Java 7)通常都包含对 JVM 和标准库的改进,因此两者通常需要一起运行,并且被打包一起在 JRE 中.

Different versions of Java (1.0, 1.1, etc. all the way to 1.7, also known as Java 7) usually contain improvements to both the JVM and the standard library, so the two usually need to run together, and are packaged together in the JRE.

如果您在计算机上运行任何 Java 程序,则说明您已安装 JRE.

If you are running any Java program on your computer, you have a JRE installed.

JDK 是 Java 开发工具包.它包含 JRE 以及许多其他对开发 Java 应用程序有用的东西.这显然包括编译器(出于某种充分的原因,它也包含在 JRE 中,但您现在可以忽略这个事实)、用于创建 .jar 文件的 JAR 实用程序、许多用于反编译"的工具.class 文件,检查 .jar 文件,重新打包它们等.

The JDK is the Java Development Kit. It contains the JRE as well as a lot of other useful stuff for developing Java applications. That includes the compiler obviously (which is also contained in the JRE for some good reason, but you can ignore this fact now), the JAR utility to create .jar files, many tools for "decompiling" class files, inspect .jar files, repackage them, etc.

它通常还包含标准库的文档以及标准库的所有源代码,因为它们对于开发人员阅读和检查很有用.如果你想认真开发Java应用程序,你需要JDK.

It also usually contains documentation for the standard library and also all the sources of the standard library, because they are useful for developers to read and inspect. If you want to seriously develop Java applications, you need the JDK.

当谈到 JavaSE、JavaEE、JavaME 等时,这些都是所谓的版本".基本上,由于 Java 生态系统非常庞大,Sun 决定提供不同版本的 Java:

When talking about JavaSE, JavaEE, JavaME etc. those are so called "editions". Basically, since the Java ecosystem is huge, Sun decided to offer Java in different editions:

  • JavaSE:是标准版,通常非常适合客户端软件、普通应用程序等.
  • JavaME:是手机版,是旧手机上的小游戏做的,但基本上是一个小"的游戏.适用于容量极低的处理器的 Java 版本.
  • JavaEE:是企业版".它用于开发服务器端的东西,所以它包含了很多服务器端使用的库.

关于编号,他们搞砸了.实际上,在 Java 1.4 之后,他们创建了 JCP,让社区参与 Java 本身的开发,从 Java 1.5 开始,它被正式命名为Java 5",尽管业内大多数人都称它为 1.5.此外,Java 1.2 是 Java 2,但我认识的每个人当时不是在 Sun 工作的 都称它为 1.2.

Regarding numbering, they messed it up quite a bit. Actually, after Java 1.4 they created the JCP, to involve the community in the development of Java itself, and starting from Java 1.5 it is officially named "Java 5", despite most in the industry calling it 1.5. Also, Java 1.2 was Java 2, but everyone I know who was not working in Sun at that time always called it 1.2.

相关文章