Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Launching a URL from an Eclipse plugin

I'd like to have my Eclipse plugin cause a URL to be opened by the users' default browser. This seems like pretty standard behavior, but I haven't been able to find any docs on how to do this.

Can anyone help?

like image 557
levik Avatar asked Nov 18 '08 19:11

levik


2 Answers

If you want it in an external browser, you don't need to create one. This is the way:

PlatformUI.getWorkbench().getBrowserSupport().getExternalBrowser().openURL(new URL("http://www.example.com/"));
like image 193
zvikico Avatar answered Oct 04 '22 13:10

zvikico


Use Program.launch(String) from the SWT API.

(Alternatively, Java 6 introduced the Desktop class.)

like image 45
McDowell Avatar answered Oct 04 '22 12:10

McDowell