jsbuild-eclipse icon indicating copy to clipboard operation
jsbuild-eclipse copied to clipboard

eclipse mac os: Build-Explorer java.io.IOException: error=2, No such file or directory

Open nimo23 opened this issue 10 years ago • 11 comments

I am using the "jsbuild-eclipse-plugin (v 0.10)" in Juno SR2 on Mac OS Yosemite. Running a task (gulp or grunt) by Build-Explorer does not work, the following error occurs:

java.io.IOException: Cannot run program "gulp" (in directory "/Users/test/workspace/myProj"): error=2, No such file or directory at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048) at java.lang.Runtime.exec(Runtime.java:620) at org.eclipse.debug.core.DebugPlugin.exec(DebugPlugin.java:871) at fr.opensagres.eclipse.jsbuild.core.launchConfigurationTypes.JSBuildFileLaunchConfigurationDelegate.launch(JSBuildFileLaunchConfigurationDelegate.java:80) at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:885) at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:739) at org.eclipse.debug.internal.ui.DebugUIPlugin.buildAndLaunch(DebugUIPlugin.java:1039) at org.eclipse.debug.internal.ui.DebugUIPlugin$8.run(DebugUIPlugin.java:1256) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) Caused by: java.io.IOException: error=2, No such file or directory at java.lang.UNIXProcess.forkAndExec(Native Method) at java.lang.UNIXProcess.(UNIXProcess.java:248) at java.lang.ProcessImpl.start(ProcessImpl.java:134) at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029) ... 8 more

It shows "No such file or directory", but there is indeed a gulp.file within this directory.

Besides, if I open eclipse by bash with "./eclipse", then running a task by "Build-Explorer" will work and no error occurs. Hower, normally a user does not open eclipse by terminal. Would be nice to fix this issue.

nimo23 avatar Apr 29 '15 14:04 nimo23

Have you tried to install with npm grunt-cli in your Eclipse project?

I have not Mac OS, so it's hard for me to fix this issue. I have windows and I had to call grunt.cmd instead of calling grunt. Perhaps it's the same problem with Mac OS.

Could you test if your terminal the call of grunt.cmd (instead of calling grunt) works?

angelozerr avatar May 01 '15 11:05 angelozerr

I am using a gulp-file, not grunt. I only clicked a gulp-target in the build-explorer and the stacktrace above is shown. If using terminal with "grunt taskname', then all works as expected. However, I want to use the Build-Explorer in Eclipse, not the terminal.

nimo23 avatar May 01 '15 21:05 nimo23

Yes I have understood your problem. When you use Build-Explorer it execute a process with the command "grunt taskname". But for windows it didn't worked. The command that It generates is "grunt.cmd taskname" and not "grunt taskname" otherwise it didn't work, although if I open a DOS command I can use "grunt taskname"?

So for Mac OS, it's perhaps the same problem. Which command must be generated?

angelozerr avatar May 01 '15 22:05 angelozerr

The odd thing is, if I open eclipse by terminal (./eclipse) instead of clicking its icon, then the build-explorer works as expected. Try opening eclipse in DOS, then build-explorer will work. However, normal users open eclipse by clicking its icon. Maybe it's a issue with permissions or shell-commands (such as -i). I dont know.

nimo23 avatar May 03 '15 18:05 nimo23

Have you try to install gulp in your eclipse project to have "/Users/test/workspace/myProj/node_modules/.bin/gulp" file and "/Users/test/workspace/myProj/gulp" folder?

angelozerr avatar May 04 '15 09:05 angelozerr

Yes, I have installed gulp and npm via cli within my project before. But it does not make a difference. As I said, running gulp tasks by terminal works. Running tasks by build-explorer only works, if I opened eclipse by terminal (./eclipse). In other cases, running tasks by build-explorer does not work.

nimo23 avatar May 06 '15 10:05 nimo23

I'm sorry @nimo23, I don't know how to fix your problem since I have not Mac.

Any contribution are welcome!

angelozerr avatar May 06 '15 12:05 angelozerr

@nimo23 could you tell me if with mac, the launch with shell "gulp.cmd" is working?

angelozerr avatar Jan 13 '16 09:01 angelozerr

@angelozerr with mac, gulp cmd on terminal works, but build-explorer does not work.

The other thing is when having gulp-tasks within subdirectories. Build-Explorer does not recognices these tasks. For example, having gulpfile.js in root-dir with this content:

// all gulp tasks are located in the ./build/tasks directory
// gulp configuration is in files in ./build directory
require('require-dir')('build/tasks');

nimo23 avatar Jan 14 '16 16:01 nimo23

@nimo23 thanks for the info. I will do a big refactoring to execute grunt/gulp with node command (and not with grunt command) like I'm doing for protractor https://github.com/angelozerr/angularjs-eclipse/wiki/Protractor

The benefit to do that is that we will able to debug gulp file.

The other thing is when having gulp-tasks within subdirectories. Build-Explorer does not recognices these tasks.

Could you create an issue with that (I'm afraid that it's not a simple work -()

angelozerr avatar Jan 16 '16 16:01 angelozerr

Ok, thanks.

https://github.com/angelozerr/jsbuild-eclipse/issues/11

nimo23 avatar Jan 16 '16 19:01 nimo23