File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Ant, Maven and Other Build Tools and the fly likes java.io.IOException: Cannot run program Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "java.io.IOException: Cannot run program "ant" " Watch "java.io.IOException: Cannot run program "ant" " New topic
Author

java.io.IOException: Cannot run program "ant"

alberto garcia perez
Greenhorn

Joined: May 17, 2013
Posts: 4
Hi all,

I'm running a Job in Hudson.
I build this job from a Hudson Master Server but the job is built in a Hudson Linux Node.
This is the result:

Started by user builder
Building remotely on Linux-Node
Updating http://150.200.20.200:8000/mvtv_all/DESCOS/MVTVc_D2ph1/branches revision: 17-may-2013 16:01:46 depth:infinity ignoreExternals: false
At revision 529
Updating http://150.200.200.200:8000/mvtv_all/DESCOS/KaluModules/branches revision: 17-may-2013 16:01:46 depth:infinity ignoreExternals: false
At revision 529
no change for http://159.200.300.20:8000/mvtv_all/DESCOS/MVTVc_D2ph1/branches since the previous build
no change for http://159.230.300.20:8000/mvtv_all/DESCOS/KaluModules/branches since the previous build
No emails were triggered.
[bt] $ ant -file build.xml -DSUBSYSTEM=ALL -DTARGET=makeBuild -DCRLIST= -DOWNER= -DbuildTool.patch.release=$RELEASE -DbuildTool.system=$SYSTEM -DbuildTool.patch.type=$PATCH_TYPE -DbuildTool.subsystem=ALL -DbuildTool.buildRules=pkgBuild -DbuildTool.dynamicView=$WORKSPACE/ALL -DbuildTool.compilationRules=compile -DbuildTool.patch.name=$PATCH_NAME makeBuild
FATAL: command execution failed.Maybe you need to configure the job to choose one of your Ant installations?
java.io.IOException: Cannot run program "ant" (in directory "/hudson/buildTool/src/bt"): error=2, No existe el fichero o el directorio
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)
at hudson.Proc$LocalProc.<init>(Proc.java:192)
at hudson.Proc$LocalProc.<init>(Proc.java:164)
at hudson.Launcher$LocalLauncher.launch(Launcher.java:639)
at hudson.Launcher$ProcStarter.start(Launcher.java:274)
at hudson.Launcher$RemoteLaunchCallable.call(Launcher.java:794)
at hudson.Launcher$RemoteLaunchCallable.call(Launcher.java:768)
at hudson.remoting.UserRequest.perform(UserRequest.java:114)
at hudson.remoting.UserRequest.perform(UserRequest.java:48)
at hudson.remoting.Request$2.run(Request.java:283)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:722)
Caused by: java.io.IOException: error=2, No existe el fichero o el directorio
at java.lang.UNIXProcess.forkAndExec(Native Method)
at java.lang.UNIXProcess.<init>(UNIXProcess.java:135)
at java.lang.ProcessImpl.start(ProcessImpl.java:130)
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1021)
... 15 more


Do you know something about this issue?

Thanks and Regards
Saif Asif
Ranch Hand

Joined: Aug 11, 2011
Posts: 440

Greetings Alberto and welcome to the ranch.

java.io.IOException: Cannot run program "ant" (in directory "/hudson/buildTool/src/bt"): error=2, No existe el fichero o el directorio


That is a no file or directory found exception. See if the directory hudson/buildTool/src/bt actualy exists and that you have read/write permissions on it.

Muhammad Saif Asif Mirza
OCJA(5/6) OCJP(6) OCJWCD(6)
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5823
    
    7

Where is Ant located on the Linux build slave? In Hudson, when you configured Ant for the build slave, did you use the correct location? In the job in question, did you specify the correct Ant version (that matches the build slave location)?


JBoss In Action
alberto garcia perez
Greenhorn

Joined: May 17, 2013
Posts: 4
Saif Asif wrote:Greetings Alberto and welcome to the ranch.

java.io.IOException: Cannot run program "ant" (in directory "/hudson/buildTool/src/bt"): error=2, No existe el fichero o el directorio


That is a no file or directory found exception. See if the directory hudson/buildTool/src/bt actualy exists and that you have read/write permissions on it.


Hi Saif!!

/hudson/buildTool/src/bt exists with the following permissions: drwxr-xr-x 8 builder builder 4096 may 17 00:11 bt
build.xml is inside with this permissions: -rwxr-xr-x 1 builder builder 6454 nov 27 16:40 build.xml

Thanks for your support.

Regards
alberto garcia perez
Greenhorn

Joined: May 17, 2013
Posts: 4
Peter Johnson wrote:Where is Ant located on the Linux build slave? In Hudson, when you configured Ant for the build slave, did you use the correct location? In the job in question, did you specify the correct Ant version (that matches the build slave location)?


Hi Peter!

Ant Location on Linux Slave: /usr/apache-ant/apache-ant-1.8.2/

This is the tool location in Hudson: (Ant 1.82) /usr/apache/apache-ant-1.8.2/bin

In the job in question I don't specify any Ant version. I select Default version. If I select Ant 1.82 version the Output Console is this:
FATAL: Cannot find executable from the choosen Ant installation "ant1.82"

Thanks!

Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5823
    
    7

alberto garcia perez wrote:Ant Location on Linux Slave: /usr/apache-ant/apache-ant-1.8.2/

This is the tool location in Hudson: (Ant 1.82) /usr/apache/apache-ant-1.8.2/bin

Is there a typo here? If not, then Hudson has the wrong location.
alberto garcia perez
Greenhorn

Joined: May 17, 2013
Posts: 4
Peter Johnson wrote:
alberto garcia perez wrote:Ant Location on Linux Slave: /usr/apache-ant/apache-ant-1.8.2/

This is the tool location in Hudson: (Ant 1.82) /usr/apache/apache-ant-1.8.2/bin

Is there a typo here? If not, then Hudson has the wrong location.


Yes, sorry.
ANT_HOME is /usr/apache/apache-ant-1.8.2/

I have solved this problem changing the Linux-Node configuration on Hudson:
Home=/usr/bin/

It works! (But I don't know the reason)

Thanks.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: java.io.IOException: Cannot run program "ant"