openvenues / jpostal

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

jpostal_expander not present #3

Closed janviparikh closed 8 years ago

janviparikh commented 8 years ago

Hi,

When I say AddressExpander.getInstance(); I get the following exception Exception in thread "main" java.lang.UnsatisfiedLinkError: no jpostal_expander in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1886) at java.lang.Runtime.loadLibrary0(Runtime.java:849) at java.lang.System.loadLibrary(System.java:1088) at com.mapzen.jpostal.AddressExpander.(AddressExpander.java:7) at addresscleanup.AddressCleanup.main(AddressCleanup.java:21)

It seems jpostal_expander is not present at all in src/main/jniLibs. Do I need to explicitly set the java library path to another location?

albarrentine commented 8 years ago

Yes, jpostal builds shared object files (.so on Linux, .jniLib on Mac) that need to be on java.library.path (after you run gradle assemble the .so files can be found in build/natives in your checkout dir). For running the tests, we set this explicitly here.

If you use gradle, there's a plugin called gradle-natives that may be helpful: https://github.com/cjstehno/coffeaelectronica/wiki/Going-Native-with-Gradle

janviparikh commented 8 years ago

Got it. Thanks!