dammit….

I have been a Java developer for nearly 8 years now… Why in the HELL have I never heard this before???

The classes that Sun includes with the Java 2 SDK, Standard Edition, fall into package groups java., javax., org. and sun.. All but the sun. packages are a standard part of the Java platform and will be supported into the future. In general, packages such as sun., that are outside of the Java platform, can be different across OS platforms Solaris, Windows, Linux, Macintosh, etc. and can change at any time without notice with SDK versions 1.2, 1.2.1, 1.2.3, etc. Programs that contain direct calls to the sun. packages are not 100% Pure Java. In other words:

The java., javax. and org. packages documented in the Java 2 Platform Standard Edition API Specification make up the official, supported, public interface.

If a Java program directly calls only API in these packages, it will operate on all Java-compatible platforms, regardless of the underlying OS platform.

The sun. packages are not part of the supported, public interface.

In general, writing java programs that rely on sun. is risky: they are not portable, and are not supported.

FAQ – Sun Packages.

dammit. dammit. dammit….

*Sigh*


Comments

  1. Jon Warren on September 24th, 2008 1:58 pm

    Hmmm…. you and I have been coding Java for just about the same length of time… and I’ve not even heard of that “sun.” package. Or at least I don’t remember it if I did. Sigh.

    Lemme guess, you just wrote a bunch of code relying upon something in that package? :-)



  2. Erik Stell on September 24th, 2008 4:24 pm

    Something like that