简体   繁体   English

如何在Eclipse for Mac中将Chrome设置为默认外部浏览器?

[英]How can I set Chrome as default external browser in Eclipse for Mac?

I think that question is self-explained :-) 我认为这个问题是自我解释的:-)

When I browse to Application eclipse send me an error. 当我浏览Application eclipse时给我发错误。

The simplest way to get Eclipse to recognize Chrome as the default system browser is : 让Eclipse将Chrome识别为默认系统浏览器的最简单方法是:

  1. Open Safari. 打开Safari。
  2. Go to menu Safari > Preferences > General. 转到菜单Safari>首选项>常规。
  3. Change 'Default web browser' to Safari. 将“默认网络浏览器”更改为Safari。
  4. Close the Preferences dialog. 关闭“首选项”对话框
  5. Re-open the Preferences dialog. 重新打开“首选项”对话框。
  6. Change 'Default web browser' to Chrome. 将“默认网络浏览器”更改为Chrome。
  7. Close the Preferences dialog. 关闭“首选项”对话框

This solution is more general as it applies to any application which chooses the incorrect system browser. 此解决方案更通用,因为它适用于选择不正确的系统浏览器的任何应用程序。 (thanks to Kelvin Lawrence at IBM) (感谢IBM的Kelvin Lawrence)

I am using Eclipse 4.2.0 on an iMac with OSX Mountain Lion. 我在带有OSX Mountain Lion的iMac上使用Eclipse 4.2.0。 This also works for Eclipse Kepler on Mountain Lion. 这也适用于Mountain Lion上的Eclipse Kepler。

I posted the answer on another question like this on stackoverflow, so here it goes: 我在stackoverflow 发布了关于这样的另一个问题答案 ,所以在这里:

I found the solution in a blog's post that doesn't exist anymore, it involves configuring the Location to be '/usr/bin/open' and the parameter is '%URL%'. 我在博客帖子中找到了不再存在的解决方案,它涉及将Location配置为'/ usr / bin / open',参数为'%URL%'。

You need to make sure that google chrome is your default browser and it will work properly. 您需要确保谷歌浏览器是您的默认浏览器,它将正常工作。 This is the only method that worked for me on OSX Lion. 这是OSX Lion上唯一适合我的方法。

我通过调用/usr/bin/open -a "/Applications/Google Chrome.app" <url>解决了这个问题

rubdottocom almost got it. rubdottocom几乎得到了它。 The problem is, that the path contains spaces. 问题是,路径包含空格。 If you write a new shell script with the following content: 如果您编写包含以下内容的新shell脚本:

'/Applications/Google Chrome.app/Contents/MacOS/Google Chrome' $1

Eclipse can launch a new Chrome instance with it. Eclipse可以用它启动一个新的Chrome实例。 Sadly, this way it is not possible to open a new tab in an already running instance, as the script exits with the following error message: 遗憾的是,这样就不可能在已经运行的实例中打开一个新选项卡,因为脚本退出并显示以下错误消息:

[21043:2307:292361872340725:ERROR:process_singleton_mac.cc(102)]
    Unable to obtain profile lock.

you can also try to fix that from eclipse at the menu bar: windows->preferences->general->web browser-> select the radio, Use external web browser and choose your default browser from there. 您还可以尝试在菜单栏中修复eclipse:windows-> preferences-> general-> web browser->选择收音机,使用外部Web浏览器并从那里选择默认浏览器。 that simple. 那么简单。

Here's a helpful visual showing the /usr/bin/open techinque: 这是一个有用的视觉效果,展示了/usr/bin/open techinque:

在此输入图像描述

Ooops! 哎呀! I find the answer here: Is there a way to add Google Chrome as an external web browser in Flash Builder Standalone for Mac? 我在这里找到答案: 有没有办法在Mac Builder的Flash Builder Standalone中将Google Chrome添加为外部网络浏览器?

The exact location is: /Applications/Google Chrome.app/Contents/MacOS/Google Chrome 确切位置为:/ Applications / Google Chrome.app/Contents/MacOS/Google Chrome

It's annoying that you can't enter inside to an "Application folder" (AppName.app) through Finder :-S 令人讨厌的是你无法通过Finder进入“应用程序文件夹”(AppName.app):-S

Oh Wait! 等一下! It's not working >_< Safari is opened 它不起作用> _ <Safari已打开

In Finder, right click on Google Chrome.app , select Show Package Contents and browse down to Contents/Mac OS and drag Google Chrome to the Location in Eclipse's Edit External Web Browser dialog box. 在Finder中,右键单击Google Chrome.app ,选择Show Package Contents并浏览到Contents / Mac OS并将Google Chrome拖到Eclipse的Edit External Web Browser对话框中的Location Enter -url %URL% in the field Parameters . 在“ 参数 ”字段中输入-url%URL% This worked for me on Eclipse Indigo on MacOS 10.7, at least when Chrome was not started before... 这对我在MacOS 10.7上的Eclipse Indigo上起作用,至少在Chrome之前没有启动时......

我在Chrome中将Chrome设置为默认浏览器的方法是:转到Window >> Web浏览器,然后选择Chrome。

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

相关问题 每当我将浏览器设置为Eclipse中的DEFAULT WEB BROWSER(Chrome)时,都会显示错误。 我该如何纠正? - Whenever I set my the browser to DEFAULT WEB BROWSER(Chrome) in Eclipse, it shows an error. How can i rectify it? 如何在Mac OS X上将Firefox正确设置为Eclipse的外部Web浏览器 - How to properly set Firefox as External Web Browser of Eclipse on Mac OS X 如何让 Eclipse 默认为“取消选择工作集” - How can I get eclipse to default to 'deselect working set' 将Vaadin默认浏览器设置为Chrome - Set Vaadin default browser as Chrome 如何在Eclipse中设置Java路径以便在外部驱动器上运行它? - How do I set the Java path in Eclipse so I can run it on an external drive? 如何在Eclipse中的“外部工具配置...”中设置“工作目录:”? - How can I set up the “Working Directory:” from the “External Tools Configuration…” in Eclipse? 是否可以在 Mac OS X 上的 Eclipse 3.6 上将 Chrome 作为外部工具运行? - Is it possible to run Chrome as an external tool on Eclipse 3.6 on Mac OS X? 如何更改默认的Eclipse控制台? - How can I change the default Eclipse console? 如何将 eclipse 重置为默认设置? - How can I reset eclipse to default settings? 创建基于Eclipse的产品时,如何设置默认工作区? - When creating an Eclipse-based Product, how can I set the default workspace?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM