-2

I need to minimize the JVM MaxHeapSize. My program keeps freezing on executing. I am using Centos 7. My JVM MaxHeapSize=2G When applying the following command:

java -Xmx1024m

I get this error:

 Usage: java [-options] class [args...]
            (to execute a class)    or  java [-options] -jar jarfile [args...]
            (to execute a jar file) where options include:
     -d32          use a 32-bit data model if available
     -d64          use a 64-bit data model if available
     -server       to select the "server" VM
                   The default VM is server,
                   because you are running on a server-class machine.

How to change jvm to a client, and how to avoid this error. With many thanks

Mohd Zoubi
  • 186
  • 3
  • 16

1 Answers1

0

The error simply says that you didn't specify which class to execute. -Xmx is a option you may specify when starting the process. java -Xmx1024m my.progs.Main will work.

Even if there is an option named -client it will have no effect. As Real differences between "java -server" and "java -client"? states this option is ignored on 64-bit systems.

blafasel
  • 1,091
  • 14
  • 25
  • Thanks blafasel, applying the above command results "Error: Could not find or load main class my.progs.Main" – Mohd Zoubi Sep 10 '17 at 06:49