Using NetBeans 6.0 RC1. When opening a PDF document from the explorer or attempting to open the Keyboard Shortcuts Card
from the Help menu, the user gets a windows command console instead of the pdf viewer.
reassign to utilities
Confirmed on Windows 2000 and Windows XP 64-bit. The new mechanism introduced by fix of bug #119333 ("Common PDF viewer
for Windows") does not work if if path of the PDF file being opened contains space.
The mechanism of the failure is the following:
cmd.exe /C start ...
actually executes a built-in command "start" with the given arguments. The root cause of the failure is that I did not
know the strange semantics of the arguments passed to it.
The semantics of the "start" command is that if the first argument is enclosed in quotes, it is considered to be a
windows title (and otherwise ignored). If the Utilities module executes
Runtime.getRuntime("cmd.exe", "/C", "start", filePath)
and the filePath contains a space character, the JRE automatically encloses the file path in quotes which causes that it
is handled like a windows title.
To prevent it, this patch adds an extra (dummy) argument to the "start" command:
Runtime.getRuntime("cmd.exe", "/C", "start", "\"PDF Viewer\"", filePath)
which is always handled as a windows title (because it is enclosed in quotes), so that the file path argument is handled
Created attachment 53257 [details]
binary patch for NB 6.0 (RC 1 or newer)
*** Issue 120257 has been marked as a duplicate of this issue. ***
Created attachment 53405 [details]
source code patch for branch 'release60'
Verified the binary patch with latest RC2 build.
The fix seems OK to me.
Committed to branch 'release60'.