如何在JRE上禁用IPv4

如何在JRE上禁用IPv4

本文介绍了如何在JRE上禁用IPv4 IP堆栈的IPv6堆栈?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

正如您在下面的屏幕截图中看到的那样,eclipse和Android SDK Manager(以及其他Java程序)正试图通过IPv6 TCP / IP堆栈连接到IPv4 Internet IP,而Proxifier(代理管理器程序,无所不能)无法支持那个。

As you can see on below screenshots, eclipse and Android SDK Manager (and other Java programs) are trying to connect to a IPv4 Internet IP via IPv6 TCP/IP stack while Proxifier (a proxy manager program, nevermind) can not support that.

我如何在Java中禁用IPv6?

How I can disable IPv6 in Java?

推荐答案

我想将这个用于我无法控制运行Java的程序应用程序以此 _JAVA_OPTIONS = -Djava.net.preferIPv4Stack = true 环境变量结束。 (阅读_JAVA_OPTIONS )

I wanted to use this for some program I hadn't control for running that Java app so ended with this _JAVA_OPTIONS=-Djava.net.preferIPv4Stack=true environment variable. (read about _JAVA_OPTIONS here)

如果你是使用Windows,只需在Windows cmd上运行此命令:

setx _JAVA_OPTIONS -Djava.net.preferIPv4Stack = true

If you are using Windows, just run this command on Windows cmd:
setx _JAVA_OPTIONS -Djava.net.preferIPv4Stack=true

感谢Jason Nichols提醒这个JVM参数:)

Thanks to Jason Nichols for reminding this JVM argument :)

这篇关于如何在JRE上禁用IPv4 IP堆栈的IPv6堆栈?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-05 15:57