3

I am building java from the Oracle source code, on Linux (SLES 11). I have gotten through the glitches up to this point, but have hit a problem where the rt.jar file is being processed.

The last command shown is

Packing /build/linux-amd64/j2re-image/lib/rt.jar 61228544 bytes

followed by the exception and stack trace:

Exception in thread "main" java.lang.ExceptionInInitializerError
        at com.sun.java.util.jar.pack.TLGlobals.<init>(TLGlobals.java:67)
        at com.sun.java.util.jar.pack.PackerImpl.<init>(PackerImpl.java:66)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
        at java.lang.Class.newInstance(Class.java:374)
        at java.util.jar.Pack200.newInstance(Pack200.java:748)
        at java.util.jar.Pack200.newPacker(Pack200.java:134)
        at com.sun.java.util.jar.pack.Driver.main(Driver.java:266)
Caused by: java.lang.SecurityException: Invalid signature file digest for Manifest main attributes
        at sun.security.util.SignatureFileVerifier.processImpl(SignatureFileVerifier.java:240)
        at sun.security.util.SignatureFileVerifier.process(SignatureFileVerifier.java:193)
        at java.util.jar.JarVerifier.processEntry(JarVerifier.java:262)
        at java.util.jar.JarVerifier.update(JarVerifier.java:216)
        at java.util.jar.JarFile.initializeVerifier(JarFile.java:345)
        at java.util.jar.JarFile.getInputStream(JarFile.java:412)
        at sun.net.www.protocol.jar.JarURLConnection.getInputStream(JarURLConnection.java:162)
        at java.net.URL.openStream(URL.java:1037)
        at java.lang.ClassLoader.getSystemResourceAsStream(ClassLoader.java:1364)
        at java.lang.Class.getResourceAsStream(Class.java:2086)
        at com.sun.java.util.jar.pack.PropMap.<clinit>(PropMap.java:127)
        ... 10 more

I am not familiar with signing jar files, and I'm not sure why the build is doing this in the first place. Any help would be appreciated.

Jman
  • 31
  • 1
  • 1
  • 3
  • You saw this? http://stackoverflow.com/questions/999489/invalid-signature-file-when-attempting-to-run-a-jar – Gray Jun 03 '13 at 21:49
  • Are you using the maven shade plugin? – Gray Jun 03 '13 at 21:51
  • Not using maven, just the make file supplied by Oracle. Had to make some minor tweaks to get to this point but nothing that should cause this problem. – Jman Jun 03 '13 at 23:05
  • This is occurring while running the pack200 command it would appear. – Jman Jun 03 '13 at 23:07

1 Answers1

4

Try removing META-INF folder from jar, adding manifest and signing JAR again, it helped me: http://jehy.ru/articles/2013/12/13/invalid-signature-file-digest-for-manifest-main-attributes/

Jehy
  • 4,729
  • 1
  • 38
  • 55