pravinkosurkar / metadata-extractor

Automatically exported from code.google.com/p/metadata-extractor
Apache License 2.0
0 stars 0 forks source link

The manifest file is missing a 'classpath' #88

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Executing the provided jar file gives this output:

$ java -jar metadata-extractor-2.6.4.jar file.jpg 
Exception in thread "main" java.lang.NoClassDefFoundError: 
com/adobe/xmp/XMPException
    at com.drew.imaging.jpeg.JpegMetadataReader.extractMetadataFromJpegSegmentReader(Unknown Source)
    at com.drew.imaging.jpeg.JpegMetadataReader.readMetadata(Unknown Source)
    at com.drew.imaging.ImageMetadataReader.readMetadata(Unknown Source)
    at com.drew.imaging.ImageMetadataReader.readMetadata(Unknown Source)
    at com.drew.imaging.ImageMetadataReader.main(Unknown Source)
Caused by: java.lang.ClassNotFoundException: com.adobe.xmp.XMPException
    at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:248)

Even adding a '-classpath xmpcore.jar' doesn't work, since the Java doc says

"When you use this option [-jar], the JAR file is the source of all user 
classes, and other user class path settings are ignored."

This is easily solved by adding a line

"Class-Path: xmpcore.jar"

in the META-INF/MANIFEST.MF file. The 'xmpcore.jar' file then needs to be in 
the same folder as the main metadata-extractor jar.

The provided MANIFEST.MF should specify this line, to easy the job of 
beginners/testers of the lib.

Original issue reported on code.google.com by vincent....@gmail.com on 23 Oct 2013 at 1:44