Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

解决 IDEA 因为 Clash 代理问题引起的疑难杂症 #51

Open
superleeyom opened this issue Sep 28, 2022 · 0 comments
Open

解决 IDEA 因为 Clash 代理问题引起的疑难杂症 #51

superleeyom opened this issue Sep 28, 2022 · 0 comments
Assignees

Comments

@superleeyom
Copy link
Owner

superleeyom commented Sep 28, 2022

前言

最近我的 IDEA 因为 Clash 的问题,出现了各种奇奇怪的问题,就这些问题的解决做一个简单的记录。

1、You have JVM property "https.proxyHost" set to "127.0.0.1"

由于我在 Mac 上开了 Clash 代理软件,接管了系统代理,打开 IDEA 的 Appearance & Behavior --> System Settings --> HTTP Proxy 界面,提示 You have JVM property "https.proxyHost" set to "127.0.0.1",解决方案就是:移除掉 Java 自带的 http 和 socket 代理,采用系统代理,选择 Help -> Edit Custom VM Options,增加如下的配置:

-Dhttp.proxyHost
-Dhttp.proxyPort
-Dhttps.proxyHost
-Dhttps.proxyPort
-DsocksProxyHost
-DsocksProxyPort

重启 IDEA 即可解决。

2、刷新 Maven 项目依赖,Build 控制台报 status: 502 Bad Gateway

因为公司有专门的 Maven 私服,而这个私服是需要通过代理才能访问,无法直接访问,这个只需要在 Maven 的 setting.xml 配置文件中,增加 HTTP 代理就行,让 Maven 强制走 Clash 代理,比如我的 Clash 的 HTTP 代理端口是 7890,则配置如下:

<proxies>
    <proxy>
        <id>clash proxy</id>
        <active>true</active>
        <protocol>http</protocol>
        <host>127.0.0.1</host>
        <port>7890</port>
    </proxy>
</proxies>

3、Maven 依赖包导入错误:GC overhead limit exceeded

该问题是于 IDEA 里为 Maven 的 importer 和 runner 设置的 JVM 最大堆内存(-Xmx)过小而导致的,只需要将 Maven 如下的两个地方设置堆内存设置大点就行:


然后重新刷新下,就不会报内存不足了。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant