Reputation: 6285
For example should I use sun.misc.IOUtils?
Upvotes: 4
Views: 859
Reputation: 76709
No, while this might appear to be fine when running on Oracle/Sun JVMs, it is certainly not the case with JVMs developed by IBM or HP, or any other organization (GNU perhaps, and probably even Apple) that does not provide these classes.
You would realize this only when you have to deploy and run on other environments.
Upvotes: 2
Reputation: 12633
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.
Upvotes: 5
Reputation: 1101
No, it's not. It's an internal API and there is no guarantee that it will stay unchanged. Use external libraries.
Upvotes: 7