K0pp0
K0pp0

Reputation: 295

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

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

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?

Upvotes: 25

Views: 144893

Answers (3)

Masterpayne
Masterpayne

Reputation: 39

Here is the link to get Java 64bit to allow a larger heap-size. Just select the "Windows Offline (64-bit)" option. https://www.java.com/en/download/manual.jsp

Upvotes: 3

Jacek Pietal
Jacek Pietal

Reputation: 2019

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

32 bit java cant use heapsize > 2G

Upvotes: 8

Sivakumar
Sivakumar

Reputation: 354

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

Upvotes: 16

Related Questions