你能准确地告诉我计算机中JDK的内容是什么吗?

huangapple go评论59阅读模式
英文:

Can you exactly tell the contents of the JDK in the computer?

问题

现在不要仅仅根据标题给这个问题点踩或者标记。我知道JDK、JRE和JVM的层次结构,但只是理论上的。我不知道它在计算机上的确切位置。我已经在我的计算机上安装了JDK,它看起来像这样。你能准确地告诉我计算机中JDK的内容是什么吗?

我的问题是,这些文件夹binconfincludejmodslegallib包含什么?JRE和JVM在哪里?开发工具在哪里?除了JVM之外,JRE的其余文件在哪里?在Linux和macOS中情况是否相同?

英文:

Now don't just downvote or flag this question based on the title. I know the hierarchy of the JDK, JRE and JVM, but only in theory. I don't know where it is located exactly on the computer. I have installed JDK on my computer and it looks like this.你能准确地告诉我计算机中JDK的内容是什么吗?

My question is what do these folders bin, conf, include, jmods, legal and lib contain? Where is the JRE and JVM? Where are the Development tools and the remaining files of the JRE except the JVM? And is this the same in Linux and macOS?

答案1

得分: 0

你正在查看一个Java 9+的发行版,这就是这个回答所涉及的内容。

  • bin目录包含工具的可执行文件。
  • conf目录包含各种配置文件。
  • include目录包含C / C++的包含文件(供那些需要针对JDK编译本地代码库的人使用)。
  • jmods目录包含(Java 9+)模块,这些模块包括标准类库和Java工具。
  • legal目录包含法律文件,例如许可证文件。
  • lib目录包含作为代码库一部分的本地代码库。

"JRE"是一种不再存在的分发方式的名称。它已不再相关。从Java 9开始,Oracle停止了分发独立的JRE分发。以前的JRE工具位于bin目录中,与本地库、模块等一起。

"JVM"是在运行Java程序时存在的抽象层。在某种程度上,你可以(勉强地)说它包括bin/java可执行文件,以及本地库等。

开发工具和除JVM之外的剩余JRE文件在bin目录中、jmod目录等。

它们与以前属于JRE的工具没有分隔开。每个开发工具都是一个运行JVM的Java应用程序,因此这种区分并没有实际意义。

在Linux和MacOS中是否相同?

是的,尽管目录结构可能有轻微差异。

(对于Linux来说,这可能取决于创建Linux发行版的人决定如何组织软件包。)

英文:

You are looking at a Java 9+ distribution there, and that is what this Answer is about.

> My question is what do these folders bin, conf, include, jmods, legal and lib contain?

  • The bin directory contains the executable files for the tools.
  • The conf directory contains various configuration files.
  • The include directory contains C / C++ include files (for people who need to compile native code libraries against the JDK).
  • The jmods directory contains the (Java 9+) modules that comprise the standard class libraries and the Java tools.
  • The legal directory contains legal documents; e.g. license documents.
  • The lib directory contains native code libraries that are part of the codebase.

> Where is the JRE and JVM?

The "JRE" is the name of a kind of distribution that no longer exists. It is no longer relevant. Oracle stopped distributing a distinct JRE distribution starting with Java 9. The (formerly) JRE tools are in the bin directory, along with native libraries, modules and so on.

The "JVM" is an abstraction that exists while you are running a Java program. To the extent that it is a tangible thing, you could (at a stretch) say that it comprises the bin/java executable together with native libraries, and so on.

> Where are the Development tools and the remaining files of the JRE except the JVM?

In the bin directory, the jmod directory and so on.

They are not segregated from the tools that were formerly part of the JRE.
Each of the development tools is a Java application that runs a JVM, so that distinction is not meaningful.

> And is this the same in Linux and MacOS?

Yes, though there might be minor differences in the directory structure.

(In the case of Linux, it may depend on how the people who create your Linux distro have decided to organize the packages.)

huangapple
  • 本文由 发表于 2020年5月5日 15:58:13
  • 转载请务必保留本文链接:https://go.coder-hub.com/61608379.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定