I have a need to limit the max heap size of the javah task.  So I am using a
<arg>:

        <javah
          classpath="${build.classes}"
          destdir="${build.native}/src/org/apache/hadoop/io/compress/zlib"
      force="yes"
          verbose="yes"
          >
          <arg value="-J-Xmx512m"/>
          <class name="org.apache.hadoop.io.compress.zlib.ZlibCompressor" />
        </javah>

But it is giving me a illegal argument error:

    [javah] Error: -J-Xmx512m is an illegal argument
    [javah]
    [javah] Usage: javah [options] <classes>
    [javah]
    [javah] where [options] include:
    [javah]
    [javah]     -help                 Print this help message and exit
    [javah]     -classpath <path>     Path from which to load classes
    [javah]     -bootclasspath <path> Path from which to load bootstrap
classes
    [javah]     -d <dir>              Output directory
    [javah]     -o <file>             Output file (only one of -d or -o may
be used)
    [javah]     -jni                  Generate JNI-style header file
(default)
    [javah]     -version              Print version information
    [javah]     -verbose              Enable verbose output
    [javah]     -force                Always write output files
    [javah]
    [javah] <classes> are specified with their fully qualified names (for
    [javah] instance, java.lang.Object).
    [javah]

When I invoke javah directly with the same argument it actually works
without error:

javah -J-Xmx512m -classpath build/classes
org.apache.hadoop.io.compress.zlib.ZlibCompressor

What am I doing wrong?

Bill

Reply via email to