Community
Participate
Working Groups
We are using the API PlatformUI.getWorkbench().getBrowserSupport().createBrowser(IWorkbenchBrowserSupport.AS_EDITOR, . . ..) to launch internal browser as an Editor. The default browser is IE8 and we want to change it to Mozilla. But there is no way to change the default internal browser. We set the Web Browser preference to use external Mozilla browser but its unable to launch because of following exception: !MESSAGE Launching C:\Program Files (x86)\Mozilla Firefox\firefox.exe has failed. !STACK 0 java.io.IOException: Cannot run program "C:\Program": CreateProcess error=2, The system cannot find the file specified. at java.lang.ProcessBuilder.start(ProcessBuilder.java:1041) at java.lang.Runtime.exec(Runtime.java:617) at java.lang.Runtime.exec(Runtime.java:450) at java.lang.Runtime.exec(Runtime.java:347) at org.eclipse.ui.internal.browser.browsers.MozillaBrowser$BrowserThread.openBrowser(MozillaBrowser.java:94) at org.eclipse.ui.internal.browser.browsers.MozillaBrowser$BrowserThread.run(MozillaBrowser.java:165) Caused by: java.io.IOException: CreateProcess error=2, The system cannot find the file specified. at java.lang.ProcessImpl.create(Native Method) at java.lang.ProcessImpl.<init>(ProcessImpl.java:376) at java.lang.ProcessImpl.start(ProcessImpl.java:136) at java.lang.ProcessBuilder.start(ProcessBuilder.java:1022) The explaination to above exception is - Runtime.exec() implementation in recent jdk versions throw java.lang.IllegalArgumentException when you try to spawn a process that has got a space in its fully qualified path name on windows platform The current workaround is to use the following vmargs in eclipse.ini: -Djdk.lang.Process.allowAmbigousCommands=true Using this vmargs we are able to launch Mozilla externally but when tried with IE launch still fails. Issues being reported: 1. PlatformUI.getWorkbench().getBrowserSupport().createBrowser should have an option to launch other browsers apart from system default as an editor. 2. The Runtime.exec() exception while launching external browser should be resolved.
What version of java are you using? PW
Wojtek, could you please try and reproduce on windows7? PW
It works fine in my environment: - Windows 7 - Firefox installed in C:\Program Files (x86)\Mozilla Firefox\firefox.exe - JRE 1.7.0_11 tested on Eclipse 4.2.1 and 4.4
Java version: java version "1.7.0" Java(TM) SE Runtime Environment (build pwi3270sr5-20130619_01(SR5)) IBM J9 VM (build 2.6, JRE 1.7.0 Windows 7 x86-32 20130617_152572 (JIT enabled, A OT enabled) J9VM - R26_Java726_SR5_20130617_1436_B152572 JIT - r11.b04_20130528_38954ifx1 GC - R26_Java726_SR5_20130617_1436_B152572 J9CL - 20130617_152572) JCL - 20130616_01 based on Oracle 7u25-b12 Environment: Windows server 2008 R2 64 Bit OS
I tested it also on Java 1.6 32bit with eclipse 32bit. Still works fine.
(In reply to Wojciech Sudol from comment #3) > - JRE 1.7.0_11 Are you using a 64-bit JRE? PW
I updated my JRE and now I am able to reproduce the bug. The problem is a result of changes in JDK 7u21 and is described here: http://www.oracle.com/technetwork/java/javase/7u21-relnotes-1932873.html#jruntime. The problem seems to be really serious and affects every place where Runtime.exec() is used.
*** This bug has been marked as a duplicate of bug 405942 ***