wood burning stoves 2.0*
The moose likes Ant, Maven and Other Build Tools and the fly likes Execute failed: java.io.IOException - error 2 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "Execute failed: java.io.IOException - error 2" Watch "Execute failed: java.io.IOException - error 2" New topic
Author

Execute failed: java.io.IOException - error 2

Afonso Alcantara
Greenhorn

Joined: Nov 24, 2004
Posts: 1
Hi,

I tried run an ant in my J2ME project, but i found this error:
BUILD FAILED: C:\des\crazy\java\build.xml:40: Execute failed: java.io.IOException: CreateProcess: preverify.exe -classpath C:\WTK21\lib\midpapi20.jar -d C:\des\crazy\java\bin\build\preverified C:\des\crazy\java\bin error=2

I am trying preverifies the code, but i don�t know what�s happen.

my target is:
<target name="preverify_SUN"
description="Previrifies">
<mkdir dir="${project.build.preverified}"/>
<exec dir="${SUN.bin.path}" (C:\WTK21\bin)
executable="preverify.exe">
<arg line="-classpath ${SUN.midp20.path}"/> (C:\WTK21\lib\midpapi20.jar)
<arg line="-d ${project.build.preverified}"/>
<arg line="${project.classes.dir}"/>
</exec>
</target>

I verified the CLASSPATH, PATH, JAVA_HOME and others things, but I don�t find the error.

I am using the Eclipse to run and to edit the Ant.

Someone can help me?
[ November 24, 2004: Message edited by: Afonso Alcantara ]
Gem Cameron
Greenhorn

Joined: Mar 21, 2006
Posts: 6
Hi

I have just had this same problem. You have to ensure the folder where this executable lives is included in your build path. You also need to explicitly define where the executable lives in your build file if it still doesn't work.

For instance my problem:
C:\workspace\WayneGrant\build.exe.xml:19: Execute failed:
java.io.IOException: CreateProcess: makensis.exe error=2

From this line:
<exec executable="makensis.exe"/>


Was fixed by:
<project name="NSIS" default="build" basedir="." >

<target name="build" >

<property name="nsis.dir" value="c:/program files/nsis" />

<exec executable="${nsis.dir}/makensis.exe"/>

</target>

</project>



Although as you reported this problem a while ago you probably don't need this solution any more! lol

Gem
Roseanne Zhang
Ranch Hand

Joined: Nov 14, 2000
Posts: 1953
I had the problem before, I remember I needed to reinstall wtk somehow to make it work properly...

Also, I used antenna from sourceforge
Parameswaran Thangavel
Ranch Hand

Joined: Mar 01, 2005
Posts: 485
Hi Cameron

i too got the same error and fixed the erro by solution given by you.

<property name="nsis.dir" value="c:/program files/nsis" />
<exec executable="${nsis.dir}/makensis.exe"/>

if we need to give the full absolute path in the executable dir itself then what for the attribute dir exist for the task <exec>.

It will be more logical if we provide the dir as the path where exe file resides and executable will hold the exact file name..

i.e

<exec executable="makensis.exe" dir="c:/program files/nsis"/>

but the above script wont work? why???

Any one who knows please clarify me.
Binod Suman
Greenhorn

Joined: May 07, 2008
Posts: 17

I have post to solve this problem in my blog.

http://binodjava.blogspot.com/2009/05/how-to-use-runtimegetruntimeexec-how-to.html

Thanks,

Binod Suman
http://binodsuman.blogspot.com
Martijn Verburg
author
Bartender

Joined: Jun 24, 2003
Posts: 3274
    
    5

Hi there,

Please DontWakeTheZombies, they bite!


Cheers, Martijn - Blog,
Twitter, PCGen, Ikasan, My The Well-Grounded Java Developer book!,
My start-up.
 
Consider Paul's rocket mass heater.
 
subject: Execute failed: java.io.IOException - error 2
 
Similar Threads
How to configure in Ant?
Ant Task to precompile JSP for Weblogic
Obfuscating Package Names
Problem packing with ant
ant tomcat dist -wrong file structure specified