Leopard 上各种 com.sun.* 包的 Java 源代码在哪里?

发布于 2024-07-28 12:01:03 字数 373 浏览 4 评论 0原文

我正在家里的 MacBook 上工作,运行 Leopard,安装了 Apple 最新的 JDK 1.6。 在IDE中,我想浏览com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel的源代码,但IDE找不到它。 我想浏览的另一个示例是 com.sun.java.swing.plaf.nimbus.ButtonPainter。

我需要将什么 JAR 或 ZIP 添加到我的 IDEA 项目中才能浏览 IDE 中的 com.sun..nimbus. 类 我只对 Leopard 感兴趣,因为这在带有 Sun 的 Windows 上运行良好JDk。

我知道 Nimbus 类可用,因为我的应用程序以 Nimbus 外观和感觉运行。

I am working on my MacBook at home, running Leopard, with the latest JDK 1.6 from Apple installed. In IDE, I'd like to browse source code for com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel, but IDE cannot find it. Another example I'd like to browse is com.sun.java.swing.plaf.nimbus.ButtonPainter.

What JAR or ZIP do I need to add to my IDEA project in order to browse com.sun..nimbus. classes inside IDE I'm only interested in Leopard, because this works fine on Windows with Sun's JDk.

I know the Nimbus classes are available, because my app runs with the Nimbus Look and Feel.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(6

洒一地阳光 2024-08-04 12:09:54

当您安装 JDK 时就会出现源代码。 查看 JDK 目录中的 src.zip。

大多数 Java 包都在那里,我相信 Swing 也会在那里。

The Source code comes when you install the JDK. Look into the JDK Directory for src.zip.

Most Java packages are there, I am sure Swing will be there too.

悍妇囚夫 2024-08-04 12:08:37

在 Mac 上,默认情况下不捆绑 JDK 源。

您需要从 Apple Developer Network 下载 XCode 内容 - 该下载中有一个可安装的 JDK 源包。 它是否包含 com.* 内容是另一个问题;-)

On the Mac, the sources to the JDK aren't bundled by default.

You'll need to download the XCode stuff from the Apple Developer Network - there's an installable package in that download for the JDK sources. Whether it contains the com.* stuff or not is a different question ;-)

捂风挽笑 2024-08-04 12:07:25

The source code for the JDK can be obtained (under varying licenses) at OpenJDK. I'm not sure how you'd go about integrating it with IntelliJ, however.

蓝眸 2024-08-04 12:06:20

正如其他人指出的那样,最好的选择是反编译代码。

然而,其他人都建议JAD,我不太喜欢它。 JD-GUI 是一个更好的反编译器,因为它可以查看 jar 和链接源,因此您可以更轻松地检查代码。 我已经用这个轻松地筛选了一些相当复杂的代码。

http://java.decompiler.free.fr/

Best bet is, as others have pointed out, to decompile the code.

However, everyone else has suggested JAD, I don't like it much. JD-GUI is a MUCH better decompiler as it can look into jars and link sources so you can inspect the code much easier. I've sifted through some rather complex code with this easily.

http://java.decompiler.free.fr/

倒数 2024-08-04 12:05:17

不幸的是,这些库的源代码并不经常分发。 如果您想检查代码,您可以下载反编译器并反编译安装中的 jar。

这里是维基百科的链接,其中有一些下载网站的后续链接对于 JAD,一个可以完成这项工作的反编译器。

Unfortunately, the source for these libraries is not often distributed. If you want to inspect the code, you could download a decompiler and decompile the jars in your install.

Here is a link to wikipedia that has a few follow-up links for download sites for JAD, a decompiler that will do the job.

深海夜未眠 2024-08-04 12:04:19

Nimbus 类位于我的 1.6 Mac 安装中:

/System/Library/Frameworks/JavaVM.framework/Versions/1.6/Classes/classes.jar

,如果您需要源代码,我会提供它们。 我使用 JadClipse 在 Eclipse 中查看 jad'ed 源代码。 当然它并不完美,但在紧要关头还是有用的。

您还可以在这里获取 JDK 1.6 源代码:

如果你提取它,你可以在 Work/j2se/src/share/classes/com/sun/java/swing/plaf/nimbus 下找到 Nimbus 源代码,

所以理论上可以将其挂接到classes.jar 上也许也能找到工作。

The Nimbus classes are here in my 1.6 Mac installation:

/System/Library/Frameworks/JavaVM.framework/Versions/1.6/Classes/classes.jar

and I would jad them if you need the source. I use JadClipse to view jad'ed source inside Eclipse. It's not perfect of course, but serves in a pinch.

You can also get JDK 1.6 source here:

If you extract it, you can find the Nimbus source down under Work/j2se/src/share/classes/com/sun/java/swing/plaf/nimbus

So could theoretically hook that up to the classes.jar and maybe get something to work too.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文