英文:
Can you exactly tell the contents of the JDK in the computer?
问题
现在不要仅仅根据标题给这个问题点踩或者标记。我知道JDK、JRE和JVM的层次结构,但只是理论上的。我不知道它在计算机上的确切位置。我已经在我的计算机上安装了JDK,它看起来像这样。
我的问题是,这些文件夹bin
、conf
、include
、jmods
、legal
和lib
包含什么?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.
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.)
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论