ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dana Rice <>
Subject RE: Sending -J-mx128m to Javac Task
Date Mon, 30 Apr 2001 16:44:14 GMT
thanks for the help, I got it to work. Well sort of. This probably is not a
true ant problem/question but you seem to have a good Unix understanding.
I'm trying to start the ant build from a cronjob. So I call a shell script
which contains the location of the ant executable, logfile, and buildfile.
So it's a one liner that looks like:
/export/home/ant1.3/dist/bin/ant -logfile export/home/tmp/antlog -buildfile
Now if I cut and paste the crontab entry that calls this one line script to
the command line everything works fine. If crontab executes it I get:
    [javac] Compiling 1020 source files to /export/home/tmp/classes


/export/home/tmp/test.xml:32: Error starting classic compiler:(I'm not using
the classic compiler) 
--- Nested Exception ---

Now I get a Unix mail message which may be the real clue:
Warning: JAVA_HOME environment variable is not set.
  If build fails because sun.* classes could not be found
  you will need to set the JAVA_HOME environment variable
  to the installation directory of java.

Something happens differently from crontab!!!?? Any ideas?

-----Original Message-----
From: Diane Holt []
Sent: Friday, April 27, 2001 5:22 PM
Subject: RE: Sending -J-mx128m to Javac Task

--- Dana Rice <> wrote:
> In my .profile. I have tried the entry JAVACMD=java -J-mx256m and
> several things people have suggested on this topic:
: java -Xmx256m,JAVA_CMD=java -mx12m.
> I get this:ksh: -J-mx256m:  not found. This on Solaris.

Not sure which JDK you're using, but I think jdk1.2.2 uses a different
flag construct than jdk1.3 uses (and I'm not sure if jdk1.1.8 even offers
the memory-increase flag at all) -- run 'java -help' to see what the java
you're running wants for flags for upping the memory (eg., mine has the -X
flag, which you can do a help on, using 'java -X -help', to show you what
the flag should look like). Then, in your .profile, export JAVACMD (not
JAVA_CMD)with that value -- be sure to export it and quote it. For
example, mine would be (using jdk1.3):

export JAVACMD="java -Xmx256m"

If you want to see what the java command-line from the 'ant' script looks
like, bracket the line with set -x/set +x:

set -x
$JAVACMD -classpath "$LOCALCLASSPATH" -Dant.home="${ANT_HOME}" $ANT_OPTS "$@"
set +x

You should see something like (I just set it on the command-line for this
[BINKY:dianeh]: JAVACMD="java -Xmx256m" ant noop
+ java -Xmx256m -classpath
\cygwin\usr\local\ant\jakarta-ant-1.3 noop
Buildfile: build.xml



Total time: 0 seconds
+ set +x



Do You Yahoo!?
Yahoo! Auctions - buy the things you want at great prices

View raw message