openvenues / jpostal

Java/JNI bindings to libpostal for for fast international street address parsing/normalization
MIT License
106 stars 44 forks source link

Exception in thread "main" java.lang.UnsatisfiedLinkError: no jpostal_parser in java.library.path #28

Open KeerthanaChowdary opened 6 years ago

KeerthanaChowdary commented 6 years ago

Running this in Mac. I have done the gradle assemble.

`package com.mapzen.jpostal;

public class test1 extends TestAddressParser {

// Singleton, parser setup is done in the constructor
public static void main(String[] args) {

    AddressParser p = AddressParser.getInstance();
    ParsedComponent[] components = p.parseAddress(
            "The Book Club 100-106 Leonard St, Shoreditch, London, Greater London, EC2A 4RH, United Kingdom");

    for (ParsedComponent c : components) {
        System.out.printf("%s: %s\n", c.getLabel(), c.getValue());
    }

}

} `

ERROR

Exception in thread "main" java.lang.UnsatisfiedLinkError: no jpostal_parser in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1867) at java.lang.Runtime.loadLibrary0(Runtime.java:870) at java.lang.System.loadLibrary(System.java:1122) at com.mapzen.jpostal.AddressParser.(AddressParser.java:8) at com.mapzen.jpostal.test1.main(test1.java:8)

mkaranta commented 6 years ago

You can check if things are set up correctly by running 'gradlew test'

If that fails then: Did you complete the step in the setup that is installing libpostal?

If it succeeds then you are likely missing the jvm argument: '-Djava.library.path=/jpostal/src/main/jniLibs'