如何检查OpenJDK的源代码库?

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

How to check source code libraries of openJDK?

问题

我已安装了openJDK 17。然后我解压了lib/src.zip文件。那里有很多目录,我找不到像java.lang或java.util这样的包。我该如何找到它们?

我已尝试使用搜索等方法。此外,我知道可以使用IntelJ或Eclipse,但我想在不使用集成开发环境的情况下完成它。

英文:

I have installed openJDK 17. Then I have unzipped file lib/src.zip. There are a lot of directories and I cannot find packages like java.lang or java.util. How can I find it?

I have tried to use search and so on. Also, I know that I can use IntelJ or Eclipse for it, but I want to do it without IDEs

答案1

得分: 1

Java的src.zip的顶级目录 - 自Java 9以来 - 是模块。包java.lang是模块java.base的一部分。您可以在zip文件中的java.base/java/lang中找到java.lang中类的源代码。

对于模块名称,目录名称是完整的模块名称,而对于包名称,每个.分隔的部分代表一个嵌套目录(java.lang -> java/langjava.lang.annotation -> java/lang/annotation,等等)。例如,java.lang.String的源代码位于文件java.base/java/lang/String.java中。

根据您的最终目标,克隆OpenJDK的GitHub存储库可能更有意义:

英文:

The top-level directories of Java's src.zip are - since Java 9 - the modules. The package java.lang is part of the module java.base. You can find the sources of classes in java.lang in java.base/java/lang inside the zip.

For module names, the directory name is the full module name, while for package names, each . separated part represents a nested directory (java.lang -> java/lang, java.lang.annotation -> java/lang/annotation, etc.). For example, the sources of java.lang.String are in the file java.base/java/lang/String.java

Depending on what your end goal is, it might make more sense to clone the GitHub repository of OpenJDK:

huangapple
  • 本文由 发表于 2023年6月8日 19:23:07
  • 转载请务必保留本文链接:https://go.coder-hub.com/76431337.html
匿名

发表评论

匿名网友

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

确定