Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where is Java source code for various com.sun.* packages on Leopard?

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.

like image 491
Eric Burke Avatar asked Jul 21 '09 12:07

Eric Burke


2 Answers

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:

  • http://download.java.net/jdk6/source/

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.

like image 86
Alex Miller Avatar answered Oct 21 '22 18:10

Alex Miller


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.

like image 45
akf Avatar answered Oct 21 '22 19:10

akf