Java库类的源代码

时间:2023-01-18 23:49:06

Where can I find the source code for the Java library classes? I mean classes in rt.jar.

我在哪里可以找到Java库类的源代码?我的意思是rt.jar中的课程。

Platform: Windows.

6 个解决方案

#1


27  

Download the JDK. The source for the public classes is in src.zip.

下载JDK。公共类的源代码是src.zip。

#2


18  

Here's the browsable source code for OpenJDK 7.

这是OpenJDK 7的可浏览源代码。

#3


8  

Sources are in src.zip located in the installation folder:

源位于安装文件夹中的src.zip:

  • On Windows, the JDK includes src.zip by default if I remember well.

    在Windows上,如果我记得很清楚,JDK默认包含src.zip。

  • On a Linux distro, you may have to install the sun-java6-source package.

    在Linux发行版上,您可能必须安装sun-java6-source软件包。

  • On Mac, you'll have to download the Developer Documentation. Have a look at this answer.

    在Mac上,您必须下载开发人员文档。看看这个答案。

#4


6  

If you only need to have a look at the source/implemenation, i would suggest using

如果您只需要查看源/实现,我建议使用

Docjar

Edit

GrepCode is even better

GrepCode甚至更好

GrepCode

#5


1  

As mention above, most of the source files can be found by downloading the SDK. However for some classes you can find the source code (javax.ssl etc') for I suggest adding the jad eclipse plugin that will decompile any class without using external site such as Docjar. Jad eclipse info: http://jadclipse.sourceforge.net/wiki/index.php/Main_Page

如上所述,可以通过下载SDK找到大多数源文件。但是对于某些类,您可以找到源代码(javax.ssl etc'),我建议添加jad eclipse插件,它将反编译任何类,而不使用Docjar等外部站点。 Jad eclipse信息:http://jadclipse.sourceforge.net/wiki/index.php/Main_Page

#6


1  

There is also grepcode.com (not sure how old this site is, perhaps this answer is an update for new solutions now), sample query:

还有grepcode.com(不知道这个网站有多久,也许这个答案现在是新解决方案的更新),示例查询:

http://grepcode.com/search?query=java.lang.Math.sin&start=0&entity=type&n=

#1


27  

Download the JDK. The source for the public classes is in src.zip.

下载JDK。公共类的源代码是src.zip。

#2


18  

Here's the browsable source code for OpenJDK 7.

这是OpenJDK 7的可浏览源代码。

#3


8  

Sources are in src.zip located in the installation folder:

源位于安装文件夹中的src.zip:

  • On Windows, the JDK includes src.zip by default if I remember well.

    在Windows上,如果我记得很清楚,JDK默认包含src.zip。

  • On a Linux distro, you may have to install the sun-java6-source package.

    在Linux发行版上,您可能必须安装sun-java6-source软件包。

  • On Mac, you'll have to download the Developer Documentation. Have a look at this answer.

    在Mac上,您必须下载开发人员文档。看看这个答案。

#4


6  

If you only need to have a look at the source/implemenation, i would suggest using

如果您只需要查看源/实现,我建议使用

Docjar

Edit

GrepCode is even better

GrepCode甚至更好

GrepCode

#5


1  

As mention above, most of the source files can be found by downloading the SDK. However for some classes you can find the source code (javax.ssl etc') for I suggest adding the jad eclipse plugin that will decompile any class without using external site such as Docjar. Jad eclipse info: http://jadclipse.sourceforge.net/wiki/index.php/Main_Page

如上所述,可以通过下载SDK找到大多数源文件。但是对于某些类,您可以找到源代码(javax.ssl etc'),我建议添加jad eclipse插件,它将反编译任何类,而不使用Docjar等外部站点。 Jad eclipse信息:http://jadclipse.sourceforge.net/wiki/index.php/Main_Page

#6


1  

There is also grepcode.com (not sure how old this site is, perhaps this answer is an update for new solutions now), sample query:

还有grepcode.com(不知道这个网站有多久,也许这个答案现在是新解决方案的更新),示例查询:

http://grepcode.com/search?query=java.lang.Math.sin&start=0&entity=type&n=