Solved Java Specify Heap Size OpenJDK11

I'm attempting to run a simple Java application with a specified max heap size (the system has more than 60GB free):

$ /usr/local/bin/java -Xmx1024m:. com.company.Main
Invalid maximum heap size: -Xmx1024m:.
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.


$ java -version
openjdk version "11.0.10" 2021-01-19
OpenJDK Runtime Environment (build 11.0.10+9-1)
OpenJDK 64-Bit Server VM (build 11.0.10+9-1, mixed mode)


Am I missing something in order to specify the JVM size? I have another machine that is using OpenJDK9 with a similar command and it's running just fine.
 
I knew it would be something as simple as that, but I didn't realize it would be *that* simple. I guess I was staring at the command for so long I didn't even notice the :. which explains all the poor search results when I was looking up that specific error!
 
Back
Top