jQuery in Action, 3rd edition
The moose likes Ant, Maven and Other Build Tools and the fly likes java.io.IOException: CreateProcess: javac 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: CreateProcess: javac" Watch "java.io.IOException: CreateProcess: javac" New topic

java.io.IOException: CreateProcess: javac

Jeeva Venkataraman

Joined: Jul 28, 2003
Posts: 1
I am getting this exception java.io.IOException: CreateProcess: on javac
I am trying do javac thru an ant task - and after successful javac on 5 entuty beans it fails to proceed further and the task fails.
The stack trace is below:
Any one got a clue?

[java] at java.lang.Win32Process.create(Native Method)
[java] at java.lang.Win32Process.<init>(Win32Process.java:63)
[java] at java.lang.Runtime.execInternal(Native Method)
[java] at java.lang.Runtime.exec(Runtime.java:550)
[java] at java.lang.Runtime.exec(Runtime.java:475)
[java] at java.lang.Runtime.exec(Runtime.java:441)
[java] at weblogic.utils.Executable.exec(Executable.java:209)
[java] at weblogic.utils.Executable.exec(Executable.java:134)
[java] at weblogic.utils.compiler.CompilerInvoker.compileMaybeExit(CompilerInvoker.java:545)
[java] at weblogic.utils.compiler.CompilerInvoker.compile(CompilerInvoker.java:372)
[java] at weblogic.utils.compiler.CompilerInvoker.compile(CompilerInvoker.java:363)
[java] at weblogic.ejb20.ejbc.EJBCompiler.compileEJB(EJBCompiler.java:246)
[java] at weblogic.ejbc20.runBody(ejbc20.java:360)
[java] at weblogic.utils.compiler.Tool.run(Tool.java:79)
[java] at weblogic.ejbc.main(ejbc.java:21)
[java] Exec failed .. exiting
[if] Error in class net.sf.antcontrib.logic.IfTask
[if] Error in class net.sf.antcontrib.logic.IfTask
Sunitha Muthireddy

Joined: Aug 15, 2003
Posts: 1
Hi have similar exception when I use ant1.5.*. But this works fine in ant1.4.2. Can you pls send the solution you made for this problem.

java beginner

Joined: Sep 05, 2002
Posts: 2
I got the same issue on Weblogic 7.0. Anybody know how to fix it?
Chad Lafontaine

Joined: Aug 19, 2003
Posts: 1
Try setting PATH arguments as follows:
<!-- Build test classpath; this includes JUnit test classes. -->
<path id="weblogic.classpath">
<path refid="build.classpath"/>
<pathelement location="${weblogic.home}/lib/weblogic.jar"/>
<!-- =================================== -->
<!-- Pre compile JSP pages if desired. -->
<!-- =================================== -->
<target name="precompilejsp" unless="skip.jsps"
description="Pre-compiles WEBAPP JSP pages.">
<java classname="weblogic.jspc" fork="true">
<!-- Note: WebLogic's EJBC and JSPC require some PATH arguments.
We define both for cygwin and cmd.exe flavors (case sensitive) -->
<env key="PATH" path="${myenv.WL_HOME}/bin;${myenv.JAVA_HOME}/bin;" />
<env key="Path" path="${myenv.WL_HOME}/bin;${myenv.JAVA_HOME}/bin;" />
<classpath refid="weblogic.classpath"/>
<arg line="-k -depend -nowarn -d ${builddir}/WEB-INF/classes -compileAll -webapp ${builddir}"/>
Muthusamy Natrayan

Joined: Oct 25, 2003
Posts: 1
Okay, this is pure classpath & path issue. Remove all the path which points to /jre/bin except one you indeded to use. This is because when you install Oracle or any other product which comes with its own version of JRE, it adds the "PATH" to your environment variable. So when you run ant and if the ant scricpt invokes java to run ejbc etc.. it may find a different version of Java and result to this error. Bottom line is clean your path,classpath and JAVA_HOME to point to the right version.
Good Luck.
-Muthusamy Natrayan
Bryon Phinney

Joined: Aug 17, 2001
Posts: 13
For future reference for those who stumble accross this thread as I did, I found the following thread helpful on the sun forums:
The help came in the Jan 15 2004 posting.
It says to put java in my PATH environment - problem solved for me.
Peter H�berli

Joined: Feb 04, 2005
Posts: 1
I had the same problem with BEA Weblogic 6.1 SP7 on Win32. After installing it as a ntservice when starting a deployed web app for the first time i got an error when wl tried to compile the generated java code of the first jsp.

The reason was:
javac wasn't found in the binary path of the system user the service was running in.

Remove the service, open the script for installing weblogic as an ntservice and go to the line where beasvc is started.
There you find a parameter -extrapath add the path to javac (f.e. c:\bea\jdk131\bin) and reinstall the service with the changed script.
VaibhaviR Shah

Joined: Mar 02, 2005
Posts: 1
Hi All,

I have verified all the path and class path. Its only pointing to the jre/bin that i need. Still running jspc as ant task i am getting following error. Any one know what it the issue and how to resolve it. Hope this its not related to the fork=true attribute in any case?

[java] [Compilation errors : ]
[java] java.io.IOException: CreateProcess: C:\j2sdk1.4.0\bin\javac.exe -g -
classpath D:\btwp\BTWP-Build\resources\lib\bcel.jar;D:\btwp\BTWP-Build\resources
[java] at java.lang.Win32Process.create(Native Method)
[java] at java.lang.Win32Process.<init>(Win32Process.java:61)
[java] at java.lang.Runtime.execInternal(Native Method)
[java] at java.lang.Runtime.exec(Runtime.java:546)
[java] at java.lang.Runtime.exec(Runtime.java:472)
[java] at java.lang.Runtime.exec(Runtime.java:438)
[java] at weblogic.utils.Executable.exec(Executable.java:208)
[java] at weblogic.utils.Executable.exec(Executable.java:133)
[java] at weblogic.utils.compiler.CompilerInvoker.compileMaybeExit(Comp
[java] at weblogic.utils.compiler.CompilerInvoker.compile(CompilerInvok
[java] at weblogic.jspc.doCompile(jspc.java:485)
[java] at weblogic.jspc.runBodyInternal(jspc.java:390)
[java] at weblogic.jspc.runBody(jspc.java:195)
[java] at weblogic.utils.compiler.Tool.run(Tool.java:126)
[java] at weblogic.jspc.main(jspc.java:582)
Carol Enderlin
Ranch Hand

Joined: Oct 10, 2000
Posts: 1364
VaibhaviR Shah,

You say you're pointing to the desired jre/bin. Hopefully you really mean jdk/bin. jre doesn't have tools such as javac.
I agree. Here's the link: http://aspose.com/file-tools
subject: java.io.IOException: CreateProcess: javac
It's not a secret anymore!