2010-01-18 81 views

回答

6

滑稽你問 - 我只需要爲我們的項目是相同的。

  1. 轉到ATF網站(http://wiki.eclipse.org/ATF/Installing) - 有如何從Zend的部位d /升XUL亞軍。
  2. 此代碼將讓你運行的瀏覽器不註冊的XULRunner:

代碼:

Bundle bundle = Platform.getBundle("org.mozilla.xulrunner"); //$NON-NLS-1$ 
if (bundle != null) 
{ 
    URL resourceUrl = bundle.getResource("xulrunner"); //$NON-NLS-1$ 
    if (resourceUrl != null) { 
     try { 
      URL fileUrl = FileLocator.toFileURL(resourceUrl); 
      File file = new File(fileUrl.toURI()); 
      System.setProperty("org.eclipse.swt.browser.XULRunnerPath",file.getAbsolutePath()); //$NON-NLS-1$ 
     } catch (IOException e) { 
      // log the exception 
     } catch (URISyntaxException e) { 
      // log the exception 
     } 
    } 
} 

更多細節在這裏:http://www.eclipse.org/swt/faq.php#howusemozilla

注:我的代碼是略與FAQ(不同的插件ID)不同 - 我以這種方式爲我工作。

+0

。過時。棄用。 – Chexpir 2015-05-07 16:54:58

4

我剛剛找到答案。

  1. 您需要在您的機器上註冊XULRunner。爲此,只需將其解壓縮,然後在命令shell xulrunner.exe --register-global中執行此命令。
  2. 傳遞SWT.MOZILLA風格瀏覽器的構造:Browser browser = new Browser(shell, SWT.MOZILLA);
+0

我是這個錯誤,無法找到解決方案:java.lang.UnsatisfiedLinkError:org.eclipse.swt.internal.mozilla.init.XPCOMInit.GREVersionRange_sizeof()我 – Chexpir 2015-05-07 16:56:59

+1

當我運行'xulrunner.exe --register -global',它告訴我'錯誤:無法解析application.ini'。老年人 – kenshinji 2016-12-06 05:34:20

相關問題