简体   繁体   English

Eclipse的挫败感

[英]Eclipse Frustration

I've been trying forever to get Eclipse to work and for some reason I am unable to install plugins, updates, or even access the marketplace. 我一直在努力让Eclipse工作,出于某种原因,我无法安装插件,更新,甚至无法访问市场。 After conducting some research, I discovered that in most cases it is a proxy issue but I'm on a private home network. 在进行一些研究后,我发现在大多数情况下这是一个代理问题,但我在私人家庭网络上。 Can anyone help me? 谁能帮我? I've been at it for days. 我已经好几天了。

This is the error I get: 这是我得到的错误:

Cannot open Eclipse Marketplace
Cannot install remote marketplace locations: Connection failed

This is most often caused by a problem with your internet connection. Please check your internet connection and retry.
Cannot complete request to http://marketplace.eclipse.org/catalogs/api/p: Unable to read repository at http://marketplace.eclipse.org/catalogs/api/p.
Unable to read repository at http://marketplace.eclipse.org/catalogs/api/p.
Permission denied: connect
Connection failed

This is most often caused by a problem with your internet connection. Please check your internet connection and retry.
Permission denied: connect

This sounds like a general OS/Java Networking problem I have seen before on Windows. 这听起来像是我以前在Windows上见过的一般OS / Java网络问题。 It is for example caused by Cisco AnyConnect VPN software, but it can be other malware scanner or personal firewealls as well I guess. 例如,它是由Cisco AnyConnect VPN软件引起的,但我猜它也可能是其他恶意软件扫描程序或个人防火墙。

It is related to IPv6 (dual stack) support in Java 7. The quickest solution (if you dont need IPv6) would be to turn the IPv6 support off, by appending this to vmargs argument of the eclipse.ini file: 它与Java 7中的IPv6(双栈)支持有关。最快的解决方案(如果不需要IPv6)是通过将其附加到eclipse.ini文件的vmargs参数来关闭IPv6支持:

-vmargs
-Xmx512m
...
-Djava.net.preferIPv4Stack=true

(end restart Eclipse). (结束重启Eclipse)。

You're quite right. 你是对的。 This can be a very frustrating experience. 这可能是非常令人沮丧的经历。

There are a number of things to consider. 有许多事情需要考虑。 Depending on your platform. 取决于您的平台。 I've given up on Windoze eons ago so my 2cts might not applicable for you. 我已经放弃了很久以前的Windoze,所以我的2条可能不适合你。 It's more for Linux/Gnome users in some cases. 在某些情况下,它更适合Linux / Gnome用户。 So here it goes. 所以这就是它。

  1. The proxy settings in n Windows => preferences => General => Network Connections. n Windows =>首选项=>常规=>网络连接中的代理设置。
    Pitfall: if you have already set your global proxy settings either though Gnome network manager or through java properties in the eclipse.ini or though environment variables, eclipse will 'sense' the settings and use a 'Native' configuration. 陷阱:如果您已经通过Gnome网络管理器或eclipse.ini中的java属性或环境变量设置了全局代理设置,eclipse将“感知”设置并使用“本机”配置。 Try to switch to 'Manual' mode. 尝试切换到“手动”模式。 Some plugins like it better. 有些插件比较好。
    Pitfall: This is not necessarily used by all plugins. 陷阱:并非所有插件都必须使用。
    • IIRC, The XML validation plugin prefers 'manual' in some versions of eclipse IIRC,XML验证插件在某些版本的eclipse中更喜欢“手动”
    • In true subversion philosophy, subclipse uses its own file (eg $HOME/.subversion/server) 按照真正的Subversion理念,subclipse使用自己的文件(例如$ HOME / .subversion / server)
    • A Maven installation will use the global settings.xml or the user settings xml (depending upon your maven upgrade policy, use one or the other). Maven安装将使用全局settings.xml或用户设置xml(取决于您的maven升级策略,使用其中一个)。 I'm assuming an external maven installation here. 我假设在这里进行外部Maven安装。

2 - As I already hinted you can also set: 2-正如我已经暗示的,您还可以设置:
- -Dhttp.proxyPort= - -Dhttp.proxyPort=
- -Dhttp.proxyHost= -Dhttp.proxyHost=
- -Dnetwork.proxy_host= - -Dnetwork.proxy_host=
- -Dnetwork.proxy_port= - -Dnetwork.proxy_port=

3 - For Linux, you can set environment variables 3 - 对于Linux,您可以设置环境变量
- http_proxy - http_proxy
- https_proxy - https_proxy
They will also result in 'Native' config for eclipse. 它们还将导致“本机”配置的日食。

More pitfalls 更多的陷阱

Finally, just to make it more fun, there are situations when the entries in your cache (see the network preferences for well known DTDs or XSDs) are corrupt because they store 40x HTML responses and it often takes some time to realize. 最后,为了使其更有趣,有些情况下缓存中的条目(请参阅众所周知的DTD或XSD的网络首选项)已损坏,因为它们存储了40x HTML响应,并且通常需要一些时间才能实现。 In the past when my company (a top dog in the network suppliers domain !!!) was enforcing a corporate proxy I ended up copying the cached files and catalogue from one eclipse instance to the next... 在过去,当我的公司(网络供应商域名中的顶级狗!!!)强制执行公司代理时,我最终将缓存的文件和目录从一个eclipse实例复制到下一个...
You can also use the DTD/XSD catalogue. 您也可以使用DTD / XSD目录。 You know you run into this kind of pb because developing in the office is a PiA (each time you save file, the XML validator kicks in and you have to wait for the timeout) and developing at home is a breeze. 你知道你碰到这种pb,因为在办公室里开发是一个PiA(每次你保存文件,XML验证器开始,你必须等待超时),在家里开发是一件轻而易举的事。

An even older story: in another top level company, they thought that we were using internet too much and only the proxy could resolve DNS. 一个更老的故事:在另一家顶级公司,他们认为我们使用互联网太多,只有代理才能解析DNS。 Of course no eclipse site update was accessible. 当然,没有可以访问eclipse站点更新。 I ended up writing a DNS that would use the corporate DNS for local names and a web service client that would interrogate other internet DNS exposing a web service interface... But that was more than 10 years ago. 我最终编写了一个DNS,它将使用企业DNS作为本地名称和一个Web服务客户端,它将询问其他互联网DNS暴露Web服务接口......但这已经超过10年了。 Yous situation is probably not that bad. 有些情况可能不是那么糟糕。

This problem was solved by setting Active Provider "Native". 通过设置Active Provider“Native”解决了此问题。 Probably corporate firewall creating problem.Enter your company proxy with port like this. 可能是企业防火墙创建问题。用这样的端口输入您的公司代理。 在此输入图像描述

Do you have any firewall setting which could be blocking the connection? 你有任何阻止连接的防火墙设置吗? Checking antivirus/firewall settings for Program permissions could help. 检查防病毒/防火墙设置的程序权限可能会有所帮助。

For what's worth, I just had the same error on Neon. 对于什么是值得的,我在霓虹灯上遇到了同样的错误。 The typical solutions (proxy settings) did not apply. 典型解决方案(代理设置)不适用。

However, just by trial and error this is my solution: which I just tried a few minutes ago. 然而,只是通过反复试验这是我的解决方案:几分钟前我刚试过。 I did an update. 我做了更新。

That's all. 就这样。 Whatever got updated included the means for Neon to reach to the marketplace end point. 无论更新的内容包括霓虹灯达到市场终点的手段。 It is working now. 它现在正在运作。

This is what I would suggest first to anyone who runs into this. 这是我首先向任何碰到这一点的人建议的。 Might not work in all cases, but it certainly worked for me. 可能在所有情况下都不起作用,但它确实对我有用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM