我必须如何配置代理设置才能让 Eclipse 下载新插件?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/5857499/
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
How do I have to configure the proxy settings so Eclipse can download new plugins?
提问by Romain Linsolas
I am working with Eclipse 3.7, on an Windows XP environment behind a web proxy.
我正在使用 Eclipse 3.7,在 Web 代理后面的 Windows XP 环境中。
I want to install the Groovy pluginon a newly unzippedEclipse Indigo (Eclipse Java EE Indigo M4).
I added the update siteto the Available Software Site
list.
我想在新解压的Eclipse Indigo ( Eclipse Java EE Indigo M4)上安装Groovy 插件。我将更新站点添加到列表中。Available Software Site
But Eclipse is not able to retrieve the information of this plugin, and thus the installation is not possible...
但是Eclipse无法检索到该插件的信息,因此无法安装...
If I put Native
configuration in General > Network Connections
, which does not have the Auth
option selected, I get the following error when I trying to reach the update site:
如果我将Native
配置放入中General > Network Connections
,但未Auth
选择该选项,则在尝试访问更新站点时会出现以下错误:
HTTP Proxy Authentication Required: http://dist.codehaus.org/groovy/distributions/greclipse/snapshot/e3.7/content.xml
HTTP Proxy Authentication Required: http://dist.codehaus.org/groovy/distributions/greclipse/snapshot/e3.7/content.xml
Proxy Authentication Required
So now, I select manual
, I define all correct information for the three schemas (HTTP, HTTPS, SOCKS): proxy, port, Auth, User and password.
However, when I try to reach the update site, Eclipse is indicating that he is Fetching children of Groovy Eclipse
, but keep this status at 0%...
所以现在,我选择manual
,我为三个模式(HTTP、HTTPS、SOCKS)定义了所有正确的信息:代理、端口、身份验证、用户和密码。但是,当我尝试访问更新站点时,Eclipse 指示他是Fetching children of Groovy Eclipse
,但将此状态保持在 0%...
What is strange is that even if I put a wrong password in the General > Network Connections
configuration, I don't get any error message.
奇怪的是,即使我在General > Network Connections
配置中输入了错误的密码,我也没有收到任何错误消息。
My questions:
我的问题:
- What is wrong in my configuration?
- Is there another way to define the proxy configuration?
- Is there a way to get more information, to know what Eclipse is trying to do (the
workspace/.metadata/.log
doesn't contain any useful information) ?
- 我的配置有什么问题?
- 还有另一种定义代理配置的方法吗?
- 有没有办法获得更多信息,了解 Eclipse 正在尝试做什么(
workspace/.metadata/.log
不包含任何有用的信息)?
Another problem (minor however) is that the modifications of the proxy settings seem to be handled only after an Eclipse restart.
另一个问题(不过是次要的)是代理设置的修改似乎只有在 Eclipse 重新启动后才能处理。
ps1:Using my browser, I can reach the update site, so it is not blocked by the proxy.
ps1:使用我的浏览器,我可以访问更新站点,因此它不会被代理阻止。
ps2:This problem is not related to this plugin, as Eclipse behaves the same way for other plugin.
ps2:此问题与此插件无关,因为 Eclipse 对其他插件的行为方式相同。
ps3:Here is the content of the workspace/.metadata/.log
when I start Eclipse and try to install the plugin (all these logs are written during the startup, none when Eclipse tries to access the update site)
ps3:这里是workspace/.metadata/.log
我启动Eclipse并尝试安装插件时的内容(所有这些日志都是在启动时写入的,Eclipse尝试访问更新站点时没有)
!SESSION 2011-05-02 10:38:58.681 -----------------------------------------------
eclipse.buildId=I20101208-1300
java.version=1.6.0_20
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=fr_FR
Framework arguments: -product org.eclipse.epp.package.jee.product
Command-line arguments: -os win32 -ws win32 -arch x86 -product org.eclipse.epp.package.jee.product
!ENTRY org.eclipse.core.net 1 0 2011-05-02 10:39:02.228
!MESSAGE System property http.proxyHost is not set but should be XXX.
!ENTRY org.eclipse.core.net 1 0 2011-05-02 10:39:02.228
!MESSAGE System property http.proxyPort is not set but should be 8080.
!ENTRY org.eclipse.core.net 1 0 2011-05-02 10:39:02.244
!MESSAGE System property https.proxyHost is not set but should be XXX.
!ENTRY org.eclipse.core.net 1 0 2011-05-02 10:39:02.244
!MESSAGE System property https.proxyPort is not set but should be 8080.
!ENTRY org.eclipse.core.net 1 0 2011-05-02 10:39:02.244
!MESSAGE System property socksProxyHost is not set but should be XXX.
!ENTRY org.eclipse.core.net 1 0 2011-05-02 10:39:02.244
!MESSAGE System property socksProxyPort is not set but should be 8080.
!ENTRY org.eclipse.core.net 1 0 2011-05-02 10:39:02.244
!MESSAGE System property https.proxyHost is not set but should be XXX.
!ENTRY org.eclipse.core.net 1 0 2011-05-02 10:39:02.244
!MESSAGE System property https.proxyPort is not set but should be 8080.
!ENTRY org.eclipse.core.net 1 0 2011-05-02 10:39:02.244
!MESSAGE System property socksProxyHost is not set but should be XXX.
!ENTRY org.eclipse.core.net 1 0 2011-05-02 10:39:02.244
!MESSAGE System property socksProxyPort is not set but should be 8080.
!ENTRY org.eclipse.core.net 1 0 2011-05-02 10:39:02.244
!MESSAGE System property socksProxyHost is not set but should be XXX.
!ENTRY org.eclipse.core.net 1 0 2011-05-02 10:39:02.244
!MESSAGE System property socksProxyPort is not set but should be 8080.
!ENTRY org.eclipse.osgi 2 1 2011-05-02 10:39:02.447
!MESSAGE NLS missing message: TaskJobFactory_Refreshing_repository_configuration in: org.eclipse.mylyn.internal.tasks.ui.messages
Edit
编辑
If I add the following lines in my eclipse.ini
file (because of that), it works:
如果我在我的eclipse.ini
文件中添加以下几行(因此),它会起作用:
-Dorg.eclipse.ecf.provider.filetransfer.excludeContributors=org.eclipse.ecf.provider.filetransfer.httpclient
-Dhttp.proxyPort=8080
-Dhttp.proxyHost=XXX
-Dhttp.proxyUser=XXX
-Dhttp.proxyPassword=XXX
-Dhttp.nonProxyHosts=localhost|127.0.0.1
But why? Does this problem still exists in Eclipse 3.7?
但为什么?这个问题在 Eclipse 3.7 中是否仍然存在?
回答by roostergx
I had the same problem. I installed Eclipse 3.7 into a new folder, and created a new workspace. I launch Eclipse with a -data argument to reference the new workspace.
我有同样的问题。我将 Eclipse 3.7 安装到一个新文件夹中,并创建了一个新工作区。我使用 -data 参数启动 Eclipse 以引用新工作区。
When I attempt to connect to the marketplace to get the SVN and Maven plugins, I get the same issues described in OP.
当我尝试连接到市场以获取 SVN 和 Maven 插件时,我遇到了 OP 中描述的相同问题。
After a few more tries, I cleared the proxy settings for SOCKSprotocol, and I was able to connect to the marketplace.
多次尝试后,我清除了 SOCKS协议的代理设置,并且能够连接到市场。
So the solution for me was to configure the manual settings for HTTP and HTTPS proxy, clear the settings for SOCKS, and restart Eclipse.
所以我的解决方案是手动配置HTTP和HTTPS代理,清除SOCKS的设置,然后重启Eclipse。
回答by Mykhaylo Adamovych
Manual + disable SOCKS didn't work for me (still tried to use SOCKS and my company proxy refused it),
Native+ changed eclipse.iniworked for me
手动 + 禁用 SOCKS 对我不起作用(仍然尝试使用 SOCKS 并且我的公司代理拒绝了它),本
机+ 更改了eclipse.ini对我有用
-Dorg.eclipse.ecf.provider.filetransfer.excludeContributors=org.eclipse.ecf.provider.filetransfer.httpclient
-Dhttp.proxyHost=myproxy
-Dhttp.proxyPort=8080
-Dhttp.proxyUser=mydomain\myusername
-Dhttp.proxyPassword=mypassword
-Dhttp.nonProxyHosts=localhost|127.0.0.1
These settings require IDE restart (sometimes with -clean -refresh
command line options).
https://bugs.eclipse.org/bugs/show_bug.cgi?id=281472
这些设置需要重新启动 IDE(有时使用-clean -refresh
命令行选项)。
https://bugs.eclipse.org/bugs/show_bug.cgi?id=281472
Java8, Eclipse Neon3, slow proxy server:
Java8、Eclipse Neon3、慢速代理服务器:
-Dorg.eclipse.ecf.provider.filetransfer.excludeContributors=org.eclipse.ecf.provider.filetransfer.httpclient4
-Dhttp.proxyHost=<proxy>
-Dhttp.proxyPort=8080
-Dhttps.proxyHost=<proxy>
-Dhttps.proxyPort=8080
-DsocksProxyHost=
-DsocksProxyPort=
-Dhttp.proxyUser=<user>
-Dhttp.proxyPassword=<pass>
-Dhttp.nonProxyHosts=localhost|127.0.0.1
-Dorg.eclipse.equinox.p2.transport.ecf.retry=5
-Dorg.eclipse.ecf.provider.filetransfer.retrieve.connectTimeout=15000
-Dorg.eclipse.ecf.provider.filetransfer.retrieve.readTimeout=1000
-Dorg.eclipse.ecf.provider.filetransfer.retrieve.retryAttempts=20
-Dorg.eclipse.ecf.provider.filetransfer.retrieve.closeTimeout=1000
-Dorg.eclipse.ecf.provider.filetransfer.browse.connectTimeout=3000
-Dorg.eclipse.ecf.provider.filetransfer.browse.readTimeout=1000
回答by razvanone
There is an eclipse.ini (sts.ini) parameter that can help:
有一个 eclipse.ini (sts.ini) 参数可以帮助:
-Djava.net.useSystemProxies=true
A lot of effort wasted on this trivial setting each time I change the work environment... See one of the related bugs on eclipse bugzilla.
每次更改工作环境时,都会在这个微不足道的设置上浪费大量精力……请参阅eclipse bugzilla上的相关错误之一。
回答by Michael
Just to add to the thread as a POSSIBLEsolution, I faced a similar issue when developing on a Linux system that was behind a company firewall. However, using a Windows XP machine, Eclipse was able to access different update sites just fine as both the manual and native network connection providers worked just fine using the company proxy.
只是为了作为可能的解决方案添加到线程中,我在公司防火墙后面的 Linux 系统上进行开发时遇到了类似的问题。然而,使用 Windows XP 机器,Eclipse 能够很好地访问不同的更新站点,因为手动和本地网络连接提供商使用公司代理都可以正常工作。
After stumbling around for some time, I came across a discussion about using NTLMv2 and an implementation to be found at http://cntlm.sourceforge.net/. To whomever posted this, I give much credit to as it helped me get past the issue running on Linux. As a side note, I was using Eclipse 3.6.2 / Helios on both the Linux and Windows distros.
在摸索了一段时间后,我遇到了有关使用 NTLMv2 的讨论以及可在http://cntlm.sourceforge.net/上找到的实现。对于发布此内容的人,我非常感谢它,因为它帮助我解决了在 Linux 上运行的问题。作为旁注,我在 Linux 和 Windows 发行版上都使用了 Eclipse 3.6.2/Helios。
Best of luck on finding a solution!
祝您找到解决方案好运!
回答by Naami
finally work for me !
终于对我来说有效了!
In Eclipse, Window > Preferences > General > Network Connections,
set Active Provider to Native
add to eclipse.ini:
在 Eclipse 中,Window > Preferences > General > Network Connections,
将 Active Provider 设置为Native
add to eclipse.ini:
-Djava.net.useSystemProxies=true
-Dhttp.proxyPort=8080
-Dhttp.proxyHost=myproxy
-Dhttp.proxyUser=mydomain\myusername
-Dhttp.proxyPassword=mypassword
-Dhttp.nonProxyHosts=localhost|127.0.0.1|192.168.*|10.*
-Dorg.eclipse.ecf.provider.filetransfer.excludeContributors=org.eclipse.ecf.provider.filetransfer.httpclient4
回答by Maxim
I installed HandyCache, in them install link on my general proxy.
我安装了 HandyCache,在我的通用代理上安装了链接。
In IE set proxy 127.0.0.1.
在 IE 中设置代理 127.0.0.1。
In Eclipse, Window > Preferences > General > Network Connections, set Active Provider = Native.
在 Eclipse 中,Window > Preferences > General > Network Connections,设置 Active Provider = Native。