2
我收到此警告用什麼來代替sun.net.www.protocol.http.HttpURLConnection.userAgent?
[javac的] SSLTunnelSocketFactory.java:120:警告: sun.net.www.protocol.http.HttpURLConnection是Sun的專有API和 可能在將來的版本 [被刪除javac的] + sun.net.www.protocol.http.HttpURLConnection.userAgent
爲
if(NetworkUtils.isIPV6Compatible()&& NetworkUtils.isValidIPV6Address(host)){
msg = "CONNECT [" + host + "]:" + port + " HTTP/1.0\n"
+ "User-Agent: "
+ sun.net.www.protocol.http.HttpURLConnection.userAgent
+ "\r\n\r\n";
}
你有一個想法,什麼C我使用(最好不是一個外部jar,但從安裝的JVM)?