IDEA提示JVM https.proxyHost代理为localhost

问题描述

IDEA打开Preferences | Appearance & Behavior | System Settings | HTTP Proxy会提示一下语句:

1
2
3
4
You have JVM proterty "https.proxyHost" set to "127.0.0.1".
This may lead to incorrect behaviour. Proxy should be set in Settings | HTTP Proxy
This JVM property is old and its usage is not recommended by Oracle.
(Note: Iy could have been assigned by some code dynamically.)

出现该问题的原因一般是我们在本地启用了代理软件,代理软件自动修改了JVM代理。

解决方式

在IDEA工具栏中找到Help选项,选择其下的Edit Custom VM Options..., 并在次文件内追加以下内容:

1
2
3
4
5
6
-Dhttp.proxyHost
-Dhttp.proxyPort
-Dhttps.proxyHost
-Dhttps.proxyPort
-DsocksProxyHost
-DsocksProxyPort