英文:
Java on macOS use system proxy automatically, how to disable it?
问题
我尝试设置export JAVA_TOOL_OPTIONS=' -Duser.language=en-US -Djava.net.useSystemProxies=false'
,但不起作用。
我使用手动下载的JDK,而不是系统内置的。
java -XshowSettings:properties -version
输出中,我们可以看到其中包含http.proxyHost
和socksProxyHost
:
Picked up JAVA_TOOL_OPTIONS: -Duser.language=en-US -Djava.net.useSystemProxies=false
Property settings:
http.proxyHost = 127.0.0.1
http.proxyPort = 7891
https.proxyHost = 127.0.0.1
https.proxyPort = 7891
java.class.path =
java.class.version = 58.0
java.net.useSystemProxies = false
jdk.debug = release
line.separator = \n
os.arch = x86_64
os.name = Mac OS X
os.version = 10.15.5
java.home = /Users/xxx/code/jdk/jdk-14.0.2.jdk/Contents/Home
path.separator = :
socksProxyHost = 127.0.0.1
socksProxyPort = 7891
......
java version "14.0.2" 2020-07-14
Java(TM) SE Runtime Environment (build 14.0.2+12-46)
Java HotSpot(TM) 64-Bit Server VM (build 14.0.2+12-46, mixed mode, sharing)
相关问题:https://stackoverflow.com/questions/36847075/how-does-jvm-automatic-setting-of-os-xs-system-proxies-work
英文:
I try set export JAVA_TOOL_OPTIONS='-Duser.language=en-US -Djava.net.useSystemProxies=false'
, but not work.
I use manually downloaded JDK, not system builtin.
java -XshowSettings:properties -version
output, we can see http.proxyHost, socksProxyHost
in it:
Picked up JAVA_TOOL_OPTIONS: -Duser.language=en-US -Djava.net.useSystemProxies=false
Property settings:
http.proxyHost = 127.0.0.1
http.proxyPort = 7891
https.proxyHost = 127.0.0.1
https.proxyPort = 7891
java.class.path =
java.class.version = 58.0
java.net.useSystemProxies = false
jdk.debug = release
line.separator = \n
os.arch = x86_64
os.name = Mac OS X
os.version = 10.15.5
java.home = /Users/xxx/code/jdk/jdk-14.0.2.jdk/Contents/Home
path.separator = :
socksProxyHost = 127.0.0.1
socksProxyPort = 7891
......
java version "14.0.2" 2020-07-14
Java(TM) SE Runtime Environment (build 14.0.2+12-46)
Java HotSpot(TM) 64-Bit Server VM (build 14.0.2+12-46, mixed mode, sharing)
Related question: https://stackoverflow.com/questions/36847075/how-does-jvm-automatic-setting-of-os-xs-system-proxies-work
答案1
得分: 2
只需使用 JAVA_TOOL_OPTIONS=-Dhttp.proxyHost=
来取消设置HTTP代理。您也可以对HTTPS执行相同操作。
英文:
Just simply use JAVA_TOOL_OPTIONS=-Dhttp.proxyHost=
to unset the http proxy. You can do the same for https as well.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论