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 148552 - [65cat] java.io.IOException: Cannot run program "make" (in directory "C:\Users\Sunbon\Documents\NetBeansProjects\Pi_1"): CreateProcess error=2, The system cannot find the file specified
Summary: [65cat] java.io.IOException: Cannot run program "make" (in directory "C:\User...
Status: VERIFIED FIXED
Alias: None
Product: cnd
Classification: Unclassified
Component: Project (show other bugs)
Version: 6.x
Hardware: All All
: P2 blocker (vote)
Assignee: Alexander Simon
URL: http://statistics.netbeans.org/except...
Keywords:
: 111811 148613 (view as bug list)
Depends on:
Blocks: 149137
  Show dependency tree
 
Reported: 2008-09-27 17:32 UTC by sunbiz
Modified: 2009-02-19 20:29 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 119093


Attachments
stacktrace (1.33 KB, text/plain)
2008-09-27 17:33 UTC, sunbiz
Details
proposed patch (10.03 KB, patch)
2008-09-30 14:27 UTC, Alexander Simon
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description sunbiz 2008-09-27 17:32:59 UTC
Build: NetBeans IDE Dev (Build 200809220201)
VM: Java HotSpot(TM) Client VM, 11.0-b15, Java(TM) SE Runtime Environment, 1.6.0_10-rc2-b32
OS: Windows Vista, 6.0, x86

User Comments:
sunbiz: Steps to reproduce:
1.) Create New C/C++ project from samples (Pi)
2.) Right-click Makefile and click Add Target
3.) give name init to target and press OK
4.) right-click on Makefile and press on the init target that can be seen now, the exception is thrown

sunbiz: Steps to reproduce:
1.) Create New C/C++ project from samples (Pi)
2.) Right-click Makefile and click Add Target
3.) give name init to target and press OK
4.) right-click on Makefile and press on the init target that can be seen now, the exception is thrown



Stacktrace: 
java.io.IOException: Cannot run program "make" (in directory "C:\Users\Sunbon\Documents\NetBeansProjects\Pi_1"): 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)
        at org.netbeans.core.execution.RunClassThread.run(RunClassThread.java:151)
Comment 1 sunbiz 2008-09-27 17:33:04 UTC
Created attachment 70724 [details]
stacktrace
Comment 2 Egor Ushakov 2008-09-29 14:03:04 UTC
The problem is that when we run makefile targets we run hardcoded "make" (see MakeBaseAction).
Make utility from the default (or active) toolchain collection should be used instead.
Comment 3 Egor Ushakov 2008-09-29 14:05:10 UTC
should be fixed in 6.5 because on windows make will never be found
Comment 4 Alexey Vladykin 2008-09-29 14:16:47 UTC
Similar issues:
- when local host is running Solaris and "make" is not available: issue 111811.
- when remote host does not have "make" command: issue 148613.
Comment 5 Alexey Vladykin 2008-09-29 14:17:14 UTC
*** Issue 148613 has been marked as a duplicate of this issue. ***
Comment 6 Alexey Vladykin 2008-09-29 14:17:54 UTC
*** Issue 111811 has been marked as a duplicate of this issue. ***
Comment 7 Egor Ushakov 2008-09-30 12:40:33 UTC
MakeActionProvider.getMakeCommand may be of use
Comment 8 Alexander Simon 2008-09-30 14:27:54 UTC
Created attachment 70901 [details]
proposed patch
Comment 9 Alexander Simon 2008-09-30 15:43:30 UTC
escalated because too many user filed this bug
Comment 10 Alexey Vladykin 2008-09-30 15:51:38 UTC
I'm OK with the proposed patch.
Comment 11 soldatov 2008-10-01 10:11:52 UTC
works for me
Comment 12 Alexander Simon 2008-10-01 11:01:29 UTC
fixed
Comment 13 Alexander Simon 2008-10-01 11:16:47 UTC
integrated in main trunk:
http://hg.netbeans.org/main/rev/bf538a5b3155
Comment 14 Quality Engineering 2008-10-01 17:36:51 UTC
Integrated into 'main-golden', will be available in build *200810011401* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/bf538a5b3155
User: Alexander Simon <alexvsimon@netbeans.org>
Log: fixing: IZ#148552:65cat] java.io.IOException: Cannot run program "make" (in directory "C:\Users\Sunbon\Documents\NetBeansProjects\Pi_1"): CreateProcess error=2, The system cannot find the file specified
Comment 15 Exceptions Reporter 2008-10-21 14:43:59 UTC
Reopening - reproduced in NetBeans IDE Dev (Build 200810210201)
http://statistics.netbeans.org/exceptions/detail.do?id=131625
Comment 16 Alexander Pepin 2008-10-21 19:12:34 UTC
Can not reproduce the issue in NB6.5RC1

Product Version: NetBeans IDE 6.5 RC1 (Build 200810171318)
Java: 1.6.0_07; Java HotSpot(TM) Client VM 10.0-b23
System: Windows Vista version 6.0 running on x86; Cp1251; ru_RU (nb)
Userdir: C:\Users\ap153252\.netbeans\6.5rc1 
Comment 17 soldatov 2008-10-22 10:03:27 UTC
I can suggest such scenario:
- Delete 'C:/msys/1.0/bin/make' from Tools|Options window
- Restart IDE
- Open makefile based project
- Expend 'Important Files' node
- Slect 'Makefile' node. Call context menu. Select 'Make'
==> exception

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>(Unknown Source)
	at java.lang.ProcessImpl.start(Unknown Source)
Caused: java.io.IOException: Cannot run program "" (in directory "C:\test_projects\test_src"): CreateProcess error=2,
The system cannot find the file specified
	at java.lang.ProcessBuilder.start(Unknown Source)
	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:235)
[catch] at org.netbeans.core.execution.RunClassThread.run(RunClassThread.java:151)
Comment 18 Alexander Pepin 2008-10-22 16:17:54 UTC
I think that the main issue is an unhandled IOException. Please fix it ASAP.
Comment 19 Alexander Simon 2008-10-22 16:59:23 UTC
>I think that the main issue is an unhandled IOException. Please fix it ASAP.
It is not true. IOException is handled and shown.
It is real P1?
As a fix I can remove error dialog.
Comment 20 Alexander Simon 2008-10-22 17:52:06 UTC
fixed, change set:
http://hg.netbeans.org/main/rev/5a06553cddd2
Development: please, review fix.
QA: please, verify fix in main trunk. Escalate IZ if it is real show stopper.
Comment 21 Sergey Grinev 2008-10-22 18:09:15 UTC
verified. This is safe and valid as a general solution for processes being run through NativeExecution.

Maybe we should introduce some UI to notify user about invalid make for this particular action? (but not in 6.5)
Comment 22 Egor Ushakov 2008-10-22 19:35:04 UTC
I agree with the fix for 6.5 but disagree in general.
Exceptions must not be masked. 
At least a log record should be done.
In case of IOException user will see return value -1 and may have no idea why he got it.
Comment 23 Quality Engineering 2008-10-23 04:50:45 UTC
Integrated into 'main-golden', will be available in build *200810230201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/5a06553cddd2
User: Alexander Simon <alexvsimon@netbeans.org>
Log: fixing: IZ#148552:[65cat] java.io.IOException: Cannot run program "make" (in directory "C:\Users\Sunbon\Documents\NetBeansProjects\Pi_1"): CreateProcess error=2, The system cannot find the file specified
Comment 24 Alexander Pepin 2008-12-09 18:36:54 UTC
verified in build 200812080201