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

◇◆丶佛笑我妖孽 提交于 2019-12-18 19:07:31

问题


I think that question is self-explained :-)

When I browse to Application eclipse send me an error.


回答1:


rubdottocom almost got it. The problem is, that the path contains spaces. If you write a new shell script with the following content:

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

Eclipse can launch a new Chrome instance with it. 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.



回答2:


The simplest way to get Eclipse to recognize Chrome as the default system browser is :

  1. Open Safari.
  2. Go to menu Safari > Preferences > General.
  3. Change 'Default web browser' to Safari.
  4. Close the Preferences dialog.
  5. Re-open the Preferences dialog.
  6. Change 'Default web browser' to 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)

I am using Eclipse 4.2.0 on an iMac with OSX Mountain Lion. This also works for Eclipse Kepler on Mountain Lion.




回答3:


I posted the answer on another question like this on stackoverflow, so here it goes:

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%'.

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.




回答4:


I solved this by calling /usr/bin/open -a "/Applications/Google Chrome.app" <url>




回答5:


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?

The exact location is: /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

Oh Wait! It's not working >_< Safari is opened




回答6:


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. that simple.




回答7:


Here's a helpful visual showing the /usr/bin/open techinque:




回答8:


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. Enter -url %URL% in the field Parameters. This worked for me on Eclipse Indigo on MacOS 10.7, at least when Chrome was not started before...




回答9:


My method to set Chrome as a default browser in eclipse is: Go to Window >> Web browser and then select Chrome.



来源:https://stackoverflow.com/questions/5322574/how-can-i-set-chrome-as-default-external-browser-in-eclipse-for-mac

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!