I don\'t find any references in JDK 7 documentation regarding sun.*
packages.
Is it deprecated. But then what are the substitutes?
For eg: sun.reflect
You have to use the java.lang.reflect
package for reflection purposes.
See: http://docs.oracle.com/javase/8/docs/api/java/lang/reflect/package-summary.html
The sun.reflect
packages are not deprecated. They are for internal use by the JDK only. Oracle (formerly Sun) does not document the internal packages and does not guarantee that they will exist on all Java platform implementations (any vendor can make a Java platform implementation) nor that they will be the same in all versions of the standard Oracle Java platform implementation.
Oracle explains this on their website:
The
sun.*
packages are not part of the supported, public interface.A Java program that directly calls into
sun.*
packages is not guaranteed to work on all Java-compatible platforms. In fact, such a program is not guaranteed to work even in future versions on the same platform.