set the System properties below and then try
String lStrhttpHost = "http.proxyHost:";
String lStrhttpPort = "http.proxyPort:";
String lStrhttpsHost = "https.proxyHost:";
String lStrhttpsPort = "https.proxyPort:";
System.setProperty(lStrhttpHost, httpProxyIP);
System.setProperty(lStrhttpPort, httpProxyPort);
System.setProperty(lStrhttpsHost, httpsProxyIP);
System.setProperty(lStrhttpsPort, httpsProxyPort);
now you are able to connect to http
if your proxy supports the socks the sets the socks
properties:
System.setProperty("socks.proxyHost", proxyHost);
System.setProperty("socks.proxyPort", proxyPort);