Question

I attached the src.zip that came with my JDK, but it seems to be missing a few files.

It's as if I don't have any of the sun.*; packages. I would understand if they maybe got changed out for java.awt.AppContext, but that doesn't exit.

I found AppContext in Container.java (been looking at how Oracle does things), but it shows me bytecode instead of actual code.

Where could I get these files? I looked around on google and found nothing /:

Another thing, when I manually import sun.awt, my IDE shows me that the package exists, but no files in it. Maybe I need to upgrade my JDK? (version 7u45, not too bad)

EDIT on December 30, 2014: Still looking for an answer, now using JDK 8u25

Was it helpful?

Solution 2

These types can be found via the OpenJDK's jdk GitHub Repository.

Here's the implementation for sun.awt.AppContext, which can be found under src > java.desktop > share > classes > sun > awt

OTHER TIPS

Often time the jar files that are eventually distributed out do not contain the source code of the library but only the built .class files, either aiming to reduce jar size or protect their source code. You may have to refer other resources in order to view the source code. I find www.codatlas.com to be a pretty good place to view some java open source projects. You can find the source code of java.awt.AppContext. It has a pretty IDE-like interface so you should be able to figure out how to use.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top