Sun ipaddressutil

Question: Hadoop source code into eclipse program error, the sun.net.util.IPAddressUtil class can't find and should be jar package

In theeclipse>>window->preference->java->complier->errors/warning->deprecated and restricted APIThe Forbidden reference TheErrorChangewarning

I am using the sun.net.util.IPAddressUtil package to check whether the string contains a valid IPv4 and IPv6 address or not.

But for addresses such as 200 and 300 it is still saying it is a valid IPv4 address, which it isn't. When I used the same package and checked for IPV6 address using :-

I get the correct result. However, IPv4 does not seem to be working or may be I am using it incorrectly. Please guide me. I don't want to use regex for IPv4 validation...


Contact Us

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed et quam est. Mauris faucibus tellus ac auctor posuere.