Configure Java Applications To Use The Proxy Server
To access external websites from a java application you must configure the
java.net classes to connect through our proxy server. All that is required is to set the proxy server host name and port as system properties.
For example, the code fragment below will set the proxy values.
Properties properties = System.getProperties();
Note: You can also pass system properties on the command line using -D options to
man java for more information).
A very simple example application is provided here