aspose file tools*
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
Author

java.io.IOException: CreateProcess: javac

Jeeva Venkataraman
Greenhorn

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?
Thanks.

[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
Greenhorn

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.


-Sunitha
java beginner
Greenhorn

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

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"/>
</path>
<!-- =================================== -->
<!-- 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}"/>
</java>
</target>
Muthusamy Natrayan
Greenhorn

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
Greenhorn

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:
http://forum.java.sun.com/thread.jsp?thread=416069&forum=423&message=1837936
The help came in the Jan 15 2004 posting.
Solution:
It says to put java in my PATH environment - problem solved for me.
Peter H�berli
Greenhorn

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.

Solution:
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
Greenhorn

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
\lib\cactus-1.4b1.jar;D:\btwp\BTWP-Build\resources\lib\castor-0.9.4.3.jar;D:\btw
p\BTWP-Build\resources\lib\commons-fileupload-1.0.jar;D:\btwp\BTWP-Build\resourc
es\lib\DnBGlobalAccess.jar;D:\btwp\BTWP-Build\resources\lib\ejbgen.jar;D:\btwp\B
TWP-Build\resources\lib\httpunit.jar;D:\btwp\BTWP-Build\resources\lib\jai_codec.
jar;D:\btwp\BTWP-Build\resources\lib\jai_core.jar;D:\btwp\BTWP-Build\resources\l
ib\jakarta-regexp-1.2.jar;D:\btwp\BTWP-Build\resources\lib\junit.jar;D:\btwp\BTW
P-Build\resources\lib\log4j-1.2.8.jar;D:\btwp\BTWP-Build\resources\lib\log4j-200
30203.jar;D:\btwp\BTWP-Build\resources\lib\log4jinit.jar;D:\btwp\BTWP-Build\reso
urces\lib\Logging.jar;D:\btwp\BTWP-Build\resources\lib\poi-2.5-final-20040302.ja
r;D:\btwp\BTWP-Build\resources\lib\poi-contrib-2.5-final-20040302.jar;D:\btwp\BT
WP-Build\resources\lib\poi-scratchpad-2.5-final-20040302.jar;D:\btwp\BTWP-Build\
resources\lib\rowD
[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
ilerInvoker.java:581)
[java] at weblogic.utils.compiler.CompilerInvoker.compile(CompilerInvok
er.java:373)
[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
drifter
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