问题
I am trying to run a Program called "YouTrack" on my server. It did always work, but after the server restarted i am getting an error message when i want to start YouTrack.
Class -Xmx1g could not be found.
I am executing this command:
java –Xmx1g –XX:MaxPermSize=500m –Djava.awt.headless=true –jar youtrack-6.5.16932.jar 8112
My system:
- ubuntu 14.04
- Plesk
- java version "1.7.0_79"
Can anybody help me? Thanks in advance.
EDIT: Updated to java version "1.8.0_77". Still doesn't work.
回答1:
Did Java 7 allow the "g" modifier on the size? I thought that came with Java 8.
- Java 7
http://docs.oracle.com/javase/7/docs/technotes/tools/solaris/java.html
-Xmxn Specifies the maximum size, in bytes, of the memory allocation pool. This value must a multiple of 1024 greater than 2 MB. Append the letter k or K to indicate kilobytes, or m or M to indicate megabytes. The default value is chosen at runtime based on system configuration.
- Java 8
https://docs.oracle.com/javase/8/docs/technotes/tools/windows/java.html
-Xmxsize Specifies the maximum size (in bytes) of the memory allocation pool in bytes. This value must be a multiple of 1024 and greater than 2 MB. Append the letter k or K to indicate kilobytes, m or M to indicate megabytes, g or G to indicate gigabytes. The default value is chosen at runtime based on system configuration. For server deployments, -Xms and -Xmx are often set to the same value. See the section "Ergonomics" in Java SE HotSpot Virtual Machine Garbage Collection Tuning Guide at http://docs.oracle.com/javase/8/docs/technotes/guides/vm/gctuning/index.html.
来源:https://stackoverflow.com/questions/36406467/java-class-xmx1g-not-found