FULL PRODUCT VERSION :
C:\test_large_jars> java -version
java version "1.6.0_27"
Java(TM) SE Runtime Environment (build 1.6.0_27-b07)
Java HotSpot(TM) Client VM (build 20.2-b06, mixed mode, sharing)
The problem reproduced also on version 1.6.0_17, 1.6.0_20 and 1.6.0_24.
ADDITIONAL OS VERSION INFORMATION :
Solaris, Linux, Windows xp... In fact, every OS I've checked so far
A DESCRIPTION OF THE PROBLEM :
I'm working in Amdocs and already contacted your ISV support team regarding this problem (ISV CASE ID - 21846627).
They agreed this issue is a bug and suggested to raise a bug to Oracle support.
The problem is that I get an error message when trying to open a jar file that is bigger than 2GB using the following java command: `java -jar [jarFileName.jar]`.
When running the command `java -jar [jarFileName.jar]` I'm getting the following error:
���Invalid or corrupt jarfile [jarFileName.jar]���
It happens on all OS and machines I've checked so far. I remember specifically WinXP, Linux and Solaris.
I also found a workaround for this problem:
When I use the command `java -cp [jarFileName.jar] [main-class]` the jar file is opened as expected (that's how we know the problem is not with the jar file itself, but with the java command���)
The problem occurs also in older versions of java, such as 1.6.0_17. But only from java 1.6.0_20 the workaround (using `java -cp [jarFileName.jar] [main-class]`) actually works.
On java 1.6.0_17 even the workaround fails with ���Exception in thread "main" java.lang.NoClassDefFoundError: [main-class]���
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1. create a valid jar file that its size is greater than 2GB, with a valid main class specified in the manifest.mf file inside.
2. run the following command on any OS, any machine and any java version that is greater that 1.6.0_17:
`java -jar [jarFileName.jar]`
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
The Java process starts and the main class start to run.
ACTUAL -
Error message is thrown and the java process stops.
ERROR MESSAGES/STACK TRACES THAT OCCUR :
���Invalid or corrupt jarfile [jarFileName.jar]���
REPRODUCIBILITY :
This bug can be reproduced always.
CUSTOMER SUBMITTED WORKAROUND :
Run the followig command:
`java -cp [jarFileName.jar] [main-class]`
NOTE: the workaround works only from java 1.6.0_20.
On java 1.6.0_17 and older even the workaround fails with following error message:
���Exception in thread "main" java.lang.NoClassDefFoundError: [main-class]���