0

I tried to open a runnable jar file from command prompt and spesify maximum memory

java -Xmx6g -jar test.zip

and got an error : unable to open this jar

Did i specify Xmx in a wrong way ?

Donotello
  • 157
  • 2
  • 2
  • 14
  • Can you post the full text of the error? And do you maybe mean test.jar instead of test.zip? – Kevin Workman Feb 24 '14 at 17:34
  • java -jar test.zip works – Donotello Feb 24 '14 at 17:38
  • 1
    Then it sounds like you don't have 6 gigs of memory, or you're using a machine that can't give that much memory to the JVM. What is the full text of the error? How much memory does your computer have? What architecture (OS and whether it's 32-bit or 64-bit) is it? – Kevin Workman Feb 24 '14 at 17:40

1 Answers1

0
  1. To use 6G os Memory is required to run Java 64 Bit
  2. Zip format is valid only if is compressed with Deflate or GZ, LZMA2 or other formats of newer zip specification is not supported.
  3. To execute the file is required:
    1. A Class with main method
    2. A "Main-Class:" attribute into the MANIFEST.MF inside META-INF with the path to the class containing the main method

More information:

Increasing the JVM maximum heap size for memory intensive applications

Maximum Java heap size of a 32-bit JVM on a 64-bit OS

Community
  • 1
  • 1
Dubas
  • 2,855
  • 1
  • 25
  • 37