JVM параметры для настройки прокси:
-Dhttp.proxyHost=proxyhostURL
-Dhttp.proxyPort=proxyPortNumber
-Dhttp.proxyUser=someUserName
-Dhttp.proxyPassword=somePassword
Из командной строки:
$> java -Dhttp.proxyHost=proxyhostURL -Dhttp.proxyPort=proxyPortNumber \
-Dhttp.proxyUser=someUserName -Dhttp.proxyPassword=somePassword HelloWorldClass
В коде:
System.getProperties().put("http.proxyHost", "someProxyURL");
System.getProperties().put("http.proxyPort", "someProxyPort");
System.getProperties().put("http.proxyUser", "someUserName");
System.getProperties().put("http.proxyPassword", "somePassword");