It is a bad practice to use Sun's proprietary Java classes?

JARC picture JARC · Dec 2, 2009 · Viewed 16k times · Source

The compiler display warnings if you use Sun's proprietary Java classes. I'm of the opinion that it's generally a bad idea to use these classes. I read this somewhere. However, aside from the warnings are there any fundamental reasons why you should not use them?

Answer

dfa picture dfa · Dec 2, 2009

Because they are internal APIs: they are subject to change in a undocumented or unsupported way and they are bound to a specific JRE/JDK (Sun in your case), limiting portability of your programs.

Try to avoid uses of such APIs, always prefer a public documented and specified class.