views:

84

answers:

2

$ java -Xms512M -Xmx1024M

while running the above command i got the bellow error. please help me how to set JVM Heap memory in Aix box. here i'm using java5.

Usage: java [-options] class [args...]
           (to execute a class)    or  java -jar [-options] jarfile [args...]
           (to execute a jar file)

where options include:
    -cp -classpath <directories and zip/jar files separated by :>
              set search path for application classes and resources
    -D<name>=<value>
              set a system property
    -verbose[:class|gc|jni]
              enable verbose output
    -version  print product version
    -showversion  print product version and continue
    -? -help  print this help message
    -X        print help on non-standard options
+11  A: 

Well, you have to execute SOME java program, not just the JVM. The options itself are fine. Try java -Xms512M -Xmx1024M -cp somejar.jar mystuff.Main or something.

Enno Shioji
A: 

What about export JAVA_OPTS="-Xms512M -Xmx1024M" (unix) or set JAVA_OPTS=-Xms512M -Xmx1024M (windows)?

Jeroen Rosenberg
That probably won't help. The `JAVA_OPTS` environment variable is not used by the `java` command.
Stephen C
Thanks for response. i have added in script and working fine now.
sagar