Setting JVM/JRE to use Windows Proxy Automatically

前端 未结 6 1391
[愿得一人]
[愿得一人] 2020-11-28 06:29

I did see the question about setting the proxy for the JVM but what I want to ask is how one can utilize the proxy that is already configured (on Windows).

Here is a

6条回答
  •  没有蜡笔的小新
    2020-11-28 06:51

    This might be a little late, but I ran into the same problem. The way I fixed it is by adding the following system property:

    -Djava.net.useSystemProxies=true
    

    Now, note that this property is set only once at startup, so it can't change when you run your application. From https://docs.oracle.com/javase/7/docs/api/java/net/doc-files/net-properties.html#Proxies:

    java.net.useSystemProxies (default: false) ... Note that this property is checked only once at startup.

提交回复
热议问题