Null Pointer Issue When Starting

Issue #5 resolved
CHRISTOPHER GWILLIAMS created an issue

This is probably a stupid oversight on my part but running the latest version on a Mac. Exiftool 8.98 installed and running fine.

Whenever I run some simple code like:

JExifTool t = new JExifTool();
            JExifInfo exif = t.getInfo(jpg);
            Map<String, String> vals = exif.getAllTagsValues();

I get the following:

#!

Exception in thread "main" java.lang.NullPointerException
    at be.pw.jexif.JExifTool.startIfNecessary(JExifTool.java:213)
    at be.pw.jexif.JExifTool.getAllTagInfo(JExifTool.java:438)
    at be.pw.jexif.JExifTool.getAllTagInfo(JExifTool.java:421)
    at be.pw.jexif.JExifInfo.getAllTagsValues(JExifInfo.java:135)
    at com.encima.EXIFReader.main(EXIFReader.java:38)

Seems like it cannot start Exiftool but I am unsure why, any ideas?

Cheers!

Comments (5)

  1. Phillip repo owner
    • changed status to open

    There is indeed a Nullpointer derefernce in the startIfNecessary method. This happens if ExifTool did not start in the first place. My best guess at the moment is that the system property "exiftool.path" is not configured correctly, it should point towards the exiftool executable (including the name and extension of the executable). Are there any other log messages ? There should be a logger with the name "be.pw.jexif.JExifTool" spitting out some error messages.

    The NPE should be fixed in the next release and the start() method should also throw an exception of ExifTool did not start.

  2. CHRISTOPHER GWILLIAMS reporter

    I have exiftool on my PATH but it seems it does not look there. EDIT: I am a moron, I was looking for a way to set the path permanently on my system, not just within the bounds of the java app. Setting within that works fine, I appreciate the quick response.

  3. Log in to comment