JAVA 无效的最大堆大小。指定的大小超过了可表示的最大大小

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/31172510/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-11 10:44:50  来源:igfitidea点击:

JAVA invalid maximum heap size. The specified size exceeds the maximum representable size

java

提问by K0pp0

I have to run this command to fix the code to a xml file:

我必须运行此命令才能将代码修复到 xml 文件中:

java -Xmx5G -cp .:jsoup-1.8.2.jar CheckSyntax test.xml > test2.xml

But it gives me this error:

但它给了我这个错误:

Invalid maximum heap size: -Xmx5G
The specified size exceeds the maximum representable size.

How can I make it work?

我怎样才能让它工作?

回答by Sivakumar

If your JVM is 32-bit you cannot use the switch -d64

如果您的 JVM 是 32 位,则不能使用开关 -d64

回答by Jacek Pietal

java -Xmx2G -cp .:jsoup-1.8.2.jar CheckSyntax test.xml > test2.xml

32 bit java cant use heapsize > 2G

32 位 java 不能使用堆大小 > 2G