Java Eclipse 不再设置时仍使用 http.proxyHost 设置

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/655045/
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-08-11 17:27:57  来源:igfitidea点击:

Eclipse still using http.proxyHost settings when no longer set

javaeclipseproxyjvm

提问by jdcotter

I'm dealing with the same sort of problem as "Zombie http.proxyHost settings for JVM on OSX" except I'm on Kubuntu 8.04 and Eclipse 3.4.2. I had to use a proxy for work but have migrated off it. I've reset everything in my environment I can find inside and outside Eclipse to get rid of setting the proxy. However when I try to use the Software Update feature I find it's still using the proxy. In the error log I can see:

我正在处理与“ OSX 上 JVM 的 Zombie http.proxyHost 设置”相同的问题,除了我使用的是 Kubuntu 8.04 和 Eclipse 3.4.2。我不得不使用代理来工作,但已经迁移了它。我已经重置了环境中我可以在 Eclipse 内外找到的所有内容,以摆脱设置代理。但是,当我尝试使用软件更新功能时,我发现它仍在使用代理。在错误日志中,我可以看到:

!ENTRY org.eclipse.core.net 1 0 2009-03-17 10:49:50.137 !MESSAGE System property http.proxyHost has been set to netproxy.blah.com by an external source. This value will be overwritten using the values from the preferences

!ENTRY org.eclipse.core.net 1 0 2009-03-17 10:49:50.164 !MESSAGE System property http.proxyPort has been set to 3128 by an external source. This value will be overwritten using the values from the preferences

!ENTRY org.eclipse.core.net 1 0 2009-03-17 10:49:50.137 !MESSAGE 系统属性 http.proxyHost 已被外部源设置为 netproxy.blah.com。将使用首选项中的值覆盖此值

!ENTRY org.eclipse.core.net 1 0 2009-03-17 10:49:50.164 !MESSAGE 系统属性 http.proxyPort 已被外部源设置为 3128。将使用首选项中的值覆盖此值

Any ideas as to what the external source might be that's setting this property?

关于设置此属性的外部源可能是什么的任何想法?

采纳答案by David Leonard

It's a bug in the preferences panel. You can see it if you tail your workspace/.metadata/.log file.

这是首选项面板中的错误。如果你拖尾你的 workspace/.metadata/.log 文件,你可以看到它。

The workaround (at least in Eclipse 3.4.2) is:

解决方法(至少在 Eclipse 3.4.2 中)是:

  • Open Window > Preferences, then General > Network Connections
  • Select Manual proxy configuration
  • Click the Add Host...button to add a 'No Proxy' entry
  • Enter a random entry, say 'localhost' and click OK
  • Click Direct connection to the Internet
  • Close the property panel with the OKbutton.
  • 打开Window > Preferences,然后General > Network Connections
  • 选择手动代理配置
  • 单击“添加主机...”按钮以添加“无代理”条目
  • 输入一个随机条目,说“localhost”,然后单击“确定”
  • 单击直接连接到 Internet
  • 使用OK按钮关闭属性面板。

回答by Mallox

I remember I had a similar problem with the mantis mylyn connector. I don't remember where exactly the entry was, but I think somewhere in the metadata folder of your workspace was an option file for this particualar plugin. Maybe something similar exists for your problem. On a windows system I've already found eclipse settings in the application folder of the users home directory. Not sure though how this is handled on Ubuntu... it's been a while.

我记得我在使用 mantis mylyn 连接器时遇到了类似的问题。我不记得条目的确切位置,但我认为您工作区的元数据文件夹中的某个地方是此特定插件的选项文件。也许您的问题存在类似的东西。在 Windows 系统上,我已经在用户主目录的应用程序文件夹中找到了 eclipse 设置。不确定这是如何在 Ubuntu 上处理的……已经有一段时间了。

Worst case you could just install another eclipse instance and see if that works. Although if the config file responsible for this problem is not somewhere in the eclipse folder, you'll still have the same problem.

最坏的情况是,您可以安装另一个 eclipse 实例,看看是否有效。尽管如果导致此问题的配置文件不在 eclipse 文件夹中的某个位置,您仍然会遇到相同的问题。

At least you'll have a hint about where it is - eclipse folder, workspace or system setting in home folder.

至少你会知道它在哪里 - 主文件夹中的 eclipse 文件夹、工作区或系统设置。

Greetings and good luck!

问候并祝你好运!

回答by Cassian

Or go to your eclipse.inifile and check if there are some parameters like :

或者转到您的eclipse.ini文件并检查是否有一些参数,例如:

-Dorg.eclipse.ecf.provider.filetransfer.excludeContributors=org.eclipse.ecf.provider.filetransfer.httpclient
-Dhttp.proxyPort=8080
-Dhttp.proxyHost=myproxy
-Dhttp.proxyUser=mydomain\myusername
-Dhttp.proxyPassword=mypassword
-Dhttp.nonProxyHosts=localhost|127.0.0.1

OR same parameters but the first one finishes in 4 like below:

OR 相同的参数,但第一个参数以 4 结束,如下所示:

  -Dorg.eclipse.ecf.provider.filetransfer.excludeContributors=org.eclipse.ecf.provider.filetransfer.httpclient4

Since release of Eclipse Kepler (4.3)

自 Eclipse Kepler (4.3) 发布以来

With this parameters you can disable the HttpClient provider and have ECF use the JRE URLConnection-based provider instead(line 1). And set proxy settings.

使用此参数,您可以禁用 HttpClient 提供程序并让 ECF 改用基于 JRE URLConnection 的提供程序(第 1 行)。并设置代理设置。