import sun.net.www.protocol.jar.Handler causes the following warning:
sun.net.www.protocol.jar.Handler is
Sun proprietary API and may be removed
in a future release
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
There is no replacement. You have these options:
Use it and fix the problem if the API is ever removed (which won’t happen in the next two years, at least). The most dangerous option but the most simple to implement.
Copy the code into a new class/package in your project to make sure it doesn’t go away. Most safe, pretty easy to implement but you don’t get bug fixes and classes in the runtime will still use the old handler.
Write your own extension of
URLStreamHandler. Most work, least return of investment, high likelihood of bugs, most dangerous.Rationale: This is a warning. Warning means: You may run into trouble if you do this. Use your common sense to decide.