ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sean Ogle" <sean.o...@syslog.at>
Subject antRun and antRun.bat problems?
Date Wed, 07 Mar 2001 18:04:40 GMT
Has anybody had problems compiling with jikes with respect to ant's use of
the antRun and antRun.bat files in the ${ANT_HOME}/bin directory? I had to
re-type the antRun file in linux because it had some embedded characters
which I couldn't see in Emacs (probably ^A or ^D ?). But now that works and
I am trying to run my script on Win 2K and it chokes in the antRun.bat file.
The third line starts with a # character which is supposedly a comment even
though Win2K uses 'rem' to start comment lines. But even worse, Win2K
appears to be breaking the classpath up at ; characters!

Check this out (from 'ant -debug deploy')
...
Execute:Java13CommandLauncher: jikes -d H:\work\java\classes -classpath
H:\work\
java\classes;H:\work\java;C:\jdk1.3.0_02\jre\lib\rt.jar +E
H:\work\java\at\syslo
g\JZorro.java

BUILD FAILED

H:\work\java\at\syslog\jzorro\build.xml:53: Error running jikes compiler
--- Nested Exception ---
java.io.IOException: CreateProcess: jikes -d H:\work\java\classes -classpath
H:\
work\java\classes;H:\work\java;C:\jdk1.3.0_02\jre\lib\rt.jar +E
H:\work\java\at\
syslog\JZorro.java error=2
        at java.lang.Win32Process.create(Native Method)
        at java.lang.Win32Process.<init>(Win32Process.java:66)
        at java.lang.Runtime.execInternal(Native Method)
        at java.lang.Runtime.exec(Runtime.java:551)
        at java.lang.reflect.Method.invoke(Native Method)
        at
org.apache.tools.ant.taskdefs.Execute$Java13CommandLauncher.exec(Exec
ute.java:509)
        at org.apache.tools.ant.taskdefs.Execute.execute(Execute.java:329)
        at
org.apache.tools.ant.taskdefs.compilers.DefaultCompilerAdapter.execut
eExternalCompile(DefaultCompilerAdapter.java:329)
        at
org.apache.tools.ant.taskdefs.compilers.Jikes.execute(Jikes.java:201)

        at org.apache.tools.ant.taskdefs.Javac.execute(Javac.java:461)
        at org.apache.tools.ant.Target.execute(Target.java:153)
        at org.apache.tools.ant.Project.runTarget(Project.java:898)
        at org.apache.tools.ant.Project.executeTarget(Project.java:536)
        at org.apache.tools.ant.Project.executeTargets(Project.java:510)
        at org.apache.tools.ant.Main.runBuild(Main.java:421)
        at org.apache.tools.ant.Main.main(Main.java:149)
So I tried to use the antRun.bat file with a command like this:

H:\work\java\at\syslog\jzorro>%ANT_HOME%\bin\antRun.bat h:\work\java
jikes -d H:
\work\java\classes -classpath
H:\work\java\classes;H:\work\java;C:\jdk1.3.0_02\j
re\lib\rt.jar +E H:\work\java\at\syslog\JZorro.java

after modifying the antRun.bat file to this:

@echo off

rem Change drive and directory to %1 (Win9X only for NT/2K use "cd /d")
cd %1
rem cd /d
rem %1\
set ANT_RUN_CMD=%2
shift
shift

set PARAMS=
:loop
echo %1
if ""%1 == "" goto runCommand
set PARAMS=%PARAMS% %1
shift
goto loop

:runCommand
echo %ANT_RUN_CMD% %PARAMS%
rem %ANT_RUN_CMD% %PARAMS%

Notice that I am not actually running the command but looking at what it is
doing instead and I get this:

-d
H:\work\java\classes
-classpath
H:\work\java\classes
H:\work\java
C:\jdk1.3.0_02\jre\lib\rt.jar
+E
H:\work\java\at\syslog\JZorro.java
ECHO is off.
jikes  -d H:\work\java\classes -classpath H:\work\java\classes H:\work\java
C:\j
dk1.3.0_02\jre\lib\rt.jar +E H:\work\java\at\syslog\JZorro.java

which clearly won't work (notice the class path).

Unfortunately I am not a Win2K batch file guru and am not sure how to
proceed. This must be simple to fix.

But the real question is why am I having this problem in the first place?

Any help would be appreciated! Thanks.

Sean


Mime
View raw message