Adding pause only adds a pause before it has the same issue
Enter any key, I do so, then it disappears as usual
I figure this is what you're looking for though
"java version "1.8.0_261"
Java(TM) SE Runtime Environment (build 1.8.0_261-b12)
Java HotSpot(TM) Client VM (build 25.261-b12, mixed mode)"
This is the most recent version, so that's not an issue
Doing some tinkering around, I noticed it saying this, maybe you can infer what to do:
On smaller numbers like 2048, this message appears:
"Error occurred during initialization of VM
Could not reserve enough space for 2097152KB object heap"
On larger numbers like 4096, this message appears:
"Invalid maximum heap size: -Xmx4096M
The specified size exceeds the maximum representable size.
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit."