java Netbeans 无法连接到互联网

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/15140566/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-31 18:37:58  来源:igfitidea点击:

Netbeans not able to connect to internet

javawindows-8netbeans-7

提问by coure2011

I am using windows 8 (64bit) but not able to get access to internet using netbeans. When I am trying to update via Help > Check for Update I am getting

我使用的是 Windows 8(64 位),但无法使用 netbeans 访问互联网。当我尝试通过“帮助”>“检查更新”进行更新时,我得到了

Check your network connection, verify that your proxy settings are configured correctly in the NetBeans IDE, or try again later.

When I am trying to access some url with a program in java I am getting error

当我尝试使用 Java 中的程序访问某些 url 时出现错误

connection refused: Address is invalid on local machine

whats going on here????

这里发生了什么????

回答by coure2011

I need to force Java to use IPv4, to do so set it by command

我需要强制 Java 使用 IPv4,通过命令设置它

setx _JAVA_OPTIONS -Djava.net.preferIPv4Stack=true

回答by vikasing

Are you behind a proxy server? Go to Tools > Options > General and try to change the network settings according to your network config. EDIT: It may also be a firewall issue.

你在代理服务器后面吗?转到工具 > 选项 > 常规并尝试根据您的网络配置更改网络设置。编辑:这也可能是防火墙问题。

回答by blackpanther

Are you using a proxy server, because if you are then you will need to use a ProxyAuthenticator java class which will can be called within your Java class. This should allow your class to access the Internet.

您是否在使用代理服务器,因为如果您是,那么您将需要使用 ProxyAuthenticator java 类,该类可以在您的 Java 类中调用。这应该允许您的班级访问 Internet。

However, it may be worth checking your NetBeans Internet settings (Tools -> Options -> General) and checking whether a HTTP Proxy authentication is being used. Even so, a ProxyAuthenticator Java class may still be required (assuming a Proxy server is being used). Please see Authenticated HTTP proxy with Java

但是,检查您的 NetBeans Internet 设置(工具 -> 选项 -> 常规)并检查是否正在使用 HTTP 代理身份验证可能是值得的。即便如此,仍可能需要 ProxyAuthenticator Java 类(假设正在使用代理服务器)。请参阅使用 Java 进行身份验证的 HTTP 代理