Using Forte and Ant- cannot run javac from ejbc20

Hello,

I am attempting to build an application involving ejb's using forte with ant. If i run the ant build script from the command line, the build is successful, if I run the build script from within forte, I fail.

THe error occours when ejbc20.main executes (which is a weblogic class).

The ejbc calls java.lang.Runtime.exec(UnknownSource). which calls java.lang.Win32Process(UnknownSource).

I'm pretty sure that the java Runtime.exec() is attempting to call javac but doesnt know where to find it (via ejbc20.main()).

the stack trace follows. ANY IDEAS on how to make forte understand its the same javac?

java.io.IOException: CreateProcess: javac -nowarn -classpath "D:\build\ejbcgen;C:\Program Files\JavaSoft\JRE\1.3.1_03\lib\rt.jar;C:\Program Files\JavaSoft\JRE\1.3.1_03\lib\i18n.jar;C:\Program Files\JavaSoft\JRE\1.3.1_03\lib\sunrsasign.jar;C:\Program Files\JavaSoft\JRE\1.3.1_03\classes;C:\jdk1.3.1_03\lib\weblogic.jar;C:\jdk1.3.1_03\bin" -d D:\build\ejbcgen D:\build\ejbcgen\mil\army\atsc\ptas\atia\business\ctgfacade\*.java D:\build\ejbcgen\mil\army\atsc\ptas\atia\entity\colTskGrp\*.java error=2

at java.lang.Win32Process.create(Native Method)

at java.lang.Win32Process.<init>(Unknown Source)

at java.lang.Runtime.execInternal(Native Method)

at java.lang.Runtime.exec(Unknown Source)

at java.lang.Runtime.exec(Unknown Source)

at java.lang.Runtime.exec(Unknown Source)

at weblogic.utils.Executable.exec(Executable.java:209)

at weblogic.utils.Executable.exec(Executable.java:134)

at weblogic.utils.compiler.CompilerInvoker.compileMaybeExit(CompilerInvoker.java:545)

at weblogic.utils.compiler.CompilerInvoker.compile(CompilerInvoker.java:372)

at weblogic.utils.compiler.CompilerInvoker.compile(CompilerInvoker.java:363)

at weblogic.ejb20.ejbc.EJBCompiler.compileEJB(EJBCompiler.java:246)

at weblogic.ejbc20.runBody(ejbc20.java:360)

at weblogic.utils.compiler.Tool.run(Tool.java:79)

at weblogic.ejbc20.main(ejbc20.java:460)

Exec failed .. exiting

scripts/build/build.xml [372] Java returned: 1

[2154 byte] By [mbreymaiera] at [2007-9-19]
# 1

Just a wild guess, but maybe ant doesn't find javac, because forte doesn't pass the same environment variables you'd get on the command line.

ant in particular needs the JAVA_HOME variable to find javac, etc.

But that shouldn't be a problem, since you can set (i think, i never really tried) the java.home property in your build.xml

<property name="java.home" value="/java/jdk1.3"

or something like that.>

Stroboskopa at 2007-7-8 > top of java,Enterprise & Remote Computing,Enterprise Technologies...