How do I set the proxy to be used by the JVM

前端 未结 19 1917
孤街浪徒
孤街浪徒 2020-11-22 05:51

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

19条回答
  •  春和景丽
    2020-11-22 06:12

    Set the java.net.useSystemProxies property to true. You can set it, for example, through the JAVA_TOOL_OPTIONS environmental variable. In Ubuntu, you can, for example, add the following line to .bashrc:

    export JAVA_TOOL_OPTIONS+=" -Djava.net.useSystemProxies=true"

提交回复
热议问题