I need to read the Manifest file from a jar file at runtime.
Code:
JarFile someJar = new JarFile(jarFile);
manifest = someJar.getManifest();
However, sometimes above code throw OutOfMemoryError exception:
java.lang.OutOfMemoryError
at java.util.zip.Inflater.init(Native Method)
at java.util.zip.Inflater.<init>(Inflater.java:83)
at java.util.zip.ZipFile.getInflater(ZipFile.java:278)
at java.util.zip.ZipFile.getInputStream(ZipFile.java:224)
at java.util.zip.ZipFile.getInputStream(ZipFile.java:192)
at java.util.jar.JarFile.getBytes(JarFile.java:361)
Can sometime tell me how avoid this exception (maybe another way to get the manifest at runtime)?
btw, I don't have the permission to change the java heap size.