Many times, a Java app needs to connect to the Internet. The most common example happens when it is reading an XML file and needs to download its schema.
I am behind
To use the system proxy setup:
java -Djava.net.useSystemProxies=true ...
Or programatically:
System.setProperty("java.net.useSystemProxies", "true");
Source: http://docs.oracle.com/javase/7/docs/api/java/net/doc-files/net-properties.html