This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 147794 - cann't launch any project on Windows XP
Summary: cann't launch any project on Windows XP
Status: VERIFIED FIXED
Alias: None
Product: cnd
Classification: Unclassified
Component: -- Other -- (show other bugs)
Version: 6.x
Hardware: All Windows XP
: P1 blocker (vote)
Assignee: Egor Ushakov
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-09-20 22:02 UTC by soldatov
Modified: 2008-09-24 14:08 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description soldatov 2008-09-20 22:02:36 UTC
I cann't launch any project(sample) on Windows XP.

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:81)
	at java.lang.ProcessImpl.start(ProcessImpl.java:30)
	at java.lang.ProcessBuilder.start(ProcessBuilder.java:452)
Caused: java.io.IOException: Cannot run program "start" (in directory "D:\tmp\Welcome_2"): CreateProcess error=2, The
system cannot find the file specified
	at java.lang.ProcessBuilder.start(ProcessBuilder.java:459)
	at org.netbeans.modules.cnd.execution.LocalNativeExecution.exec(LocalNativeExecution.java:184)
	at org.netbeans.modules.cnd.execution.LocalNativeExecution.executeCommand(LocalNativeExecution.java:112)
	at org.netbeans.modules.cnd.api.execution.NativeExecutor.run(NativeExecutor.java:257)
[catch] at org.netbeans.core.execution.RunClassThread.run(RunClassThread.java:151)
Comment 1 Sergey Grinev 2008-09-21 01:49:02 UTC
The reason are latest changes to LocalNativeExecutor: ProcessBuilder can't run Windows "start" commands because there is
no associated executable.

N.B.: For some reason "Output Window" mode doesn't work too, which can be another issue.
Comment 2 Alexander Simon 2008-09-22 09:44:11 UTC
Command "start args" equals "cmd.exe /c start args".
Comment 3 Alexander Simon 2008-09-22 09:47:22 UTC
So following hack in LocalNativeExecution.exec() works:
--------------------------
        // copy the call string
        String[] call= null;
        if (processName.equals("start")) {
            call = new String[args.length + 3];
            call[0] = "cmd.exe";
            call[1] = "/c";
            call[2] = "start";
            System.arraycopy(args, 0, call, 3, args.length);
        } else {
            call = new String[args.length + 1];
            call[0] = processName;
            System.arraycopy(args, 0, call, 1, args.length);
        }
--------------------------
Comment 4 Egor Ushakov 2008-09-22 11:11:50 UTC
I removed stdouterr.sh and .bat scripts from the run process, that's why we can no longer execute cmd and shell commands.
Comment 5 Egor Ushakov 2008-09-22 18:45:57 UTC
external terminal fixed in:
http://hg.netbeans.org/main/rev/792878bd2414
however the problem with output window still remains.
On windows we do not know the full name of the executable (with .exe)
Comment 6 Egor Ushakov 2008-09-23 13:37:47 UTC
fixed with the changesets:
http://hg.netbeans.org/main/rev/792878bd2414
http://hg.netbeans.org/main/rev/7fde204f35be
Comment 7 Alexander Ioffe 2008-09-24 14:08:42 UTC
Verified in build 20080924