Most sun libraries are party of the standard jdk, it obviously depends on the exact package you are trying to use. But I would expect most sun. packages to be accessible.
A common problem can be class-loader problems or library conflicts. When doing the upgrade from 4 to 5, the platform introduces the concept of OSGi which requires a different setup of libraries.
The easiest way to get the libraries you need is to remove all libraries from your userlib folder and re-add only what you need. The appstore modules come with the libraries, so you can re-download them from the appstore.
Only for your custom Java code (if you have any) you would have to add the jar files that you are using yourself.
Alternatively you also review all libraries in your userlib folder one-by-one to evaluate what can be removed, but it's probably quicker to remove and re-download the libraries.