Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Execute failed: java.io.IOException - error 2

 
Afonso Alcantara
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1953
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 485
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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
Posts: 3275
5
Eclipse IDE Java Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there,

Please DontWakeTheZombies, they bite!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic