Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sun's Java Package Naming Convention: sun vs. com.sun

In JRE, Sun's internal packages are prefixed with 2 top-level domains (sun and com). For example,

com.sun.security.jgss
sun.security.jgss

It seems pretty random to me which prefix they choose. I am curious what rules Sun uses for this.

like image 428
ZZ Coder Avatar asked Aug 26 '09 00:08

ZZ Coder


1 Answers

Not an answer to the question, but please be aware that you should not use 'sun' or 'com.sun' packages in your programs directly.

See Why Developers Should Not Write Programs That Call 'sun' Packages

Those packages are not part of the public API of the standard Java library, and using them might make your program incompatible with future versions of Java or implementations of Java other than the Sun implementation (and there are several implementations by other vendors, including Apple, IBM and HP).

like image 102
Jesper Avatar answered Oct 05 '22 01:10

Jesper