Return-Path: Delivered-To: apmail-jakarta-ant-user-archive@jakarta.apache.org Received: (qmail 9674 invoked by uid 500); 30 Apr 2001 16:44:29 -0000 Mailing-List: contact ant-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Reply-To: ant-user@jakarta.apache.org Delivered-To: mailing list ant-user@jakarta.apache.org Received: (qmail 9625 invoked from network); 30 Apr 2001 16:44:26 -0000 Message-ID: <5BEBB69C4285D411934B00508B5C45F2910C05@SCL4MLBX09> From: Dana Rice To: "'ant-user@jakarta.apache.org'" Subject: RE: Sending -J-mx128m to Javac Task Date: Mon, 30 Apr 2001 09:44:14 -0700 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2654.52) Content-Type: text/plain; charset="iso-8859-1" X-Spam-Rating: h31.sny.collab.net 1.6.2 0/1000/N Dianne, 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 /export/home/tmp/test.xml. 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: compile: [javac] Compiling 1020 source files to /export/home/tmp/classes java.lang.OutOfMemoryError BUILD FAILED /export/home/tmp/test.xml:32: Error starting classic compiler:(I'm not using the classic compiler) --- Nested Exception --- java.lang.reflect.InvocationTargetException 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? Thanks Dana -----Original Message----- From: Diane Holt [mailto:holtdl@yahoo.com] Sent: Friday, April 27, 2001 5:22 PM To: ant-user@jakarta.apache.org 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 org.apache.tools.ant.Main "$@" set +x You should see something like (I just set it on the command-line for this example): [BINKY:dianeh]: JAVACMD="java -Xmx256m" ant noop + java -Xmx256m -classpath .;D:\cygwin\usr\local\ant\jakarta-ant-1.3\lib\ant.jar;D:\cygwin\usr\local\an t\jakarta-ant-1.3\lib\jakarta-ant-1.3-optional.jar;D:\cygwin\usr\local\ant\j akarta-ant-1.3\lib\jaxp.jar;D:\cygwin\usr\local\ant\jakarta-ant-1.3\lib\pars er.jar;D:\cygwin\usr\local\java\jdk13\lib\tools.jar -Dant.home=D: \cygwin\usr\local\ant\jakarta-ant-1.3 org.apache.tools.ant.Main noop Buildfile: build.xml noop: BUILD SUCCESSFUL Total time: 0 seconds + set +x Diane ===== (holtdl@yahoo.com) __________________________________________________ Do You Yahoo!? Yahoo! Auctions - buy the things you want at great prices http://auctions.yahoo.com/