2010-01-18 12 views

Respuesta

6

divertido con lo solicitado - Sólo necesitaba lo mismo para nuestro proyecto.

  1. Ir al sitio de ATF (http://wiki.eclipse.org/ATF/Installing) - aquí le mostramos cómo encontrar el/del XUL Runner en el sitio de Zend.
  2. Este código le permitirá ejecutar el navegador sin registrar la XULRunner:

Código:

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 
     } 
    } 
} 

Más detalles aquí: http://www.eclipse.org/swt/faq.php#howusemozilla

Nota: mi código es ligeramente diferente de las preguntas frecuentes (ID de complemento diferente) - me funciona de esta manera.

+0

viejo. anticuado. obsoleto. – Chexpir

4

Acabo de encontrar la respuesta.

  1. Necesita tener XULRunner registrado en su máquina. Para hacerlo, simplemente descomprímalo y luego ejecute este comando en el shell de comandos xulrunner.exe --register-global.
  2. Pasar el estilo SWT.MOZILLA al constructor del navegador: Browser browser = new Browser(shell, SWT.MOZILLA);
+0

yo soy este error, no puede encontrar la solución: java.lang.UnsatisfiedLinkError: org.eclipse.swt.internal.mozilla.init.XPCOMInit.GREVersionRange_sizeof() Me – Chexpir

+1

Cuando ejecuto 'xulrunner.exe --register -global', me dice que 'Error: no se pudo analizar application.ini'. – kenshinji

Cuestiones relacionadas