diff options
Diffstat (limited to 'jniwrap')
| -rw-r--r-- | jniwrap/README.md | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/jniwrap/README.md b/jniwrap/README.md index 3a6b35be..e5748cda 100644 --- a/jniwrap/README.md +++ b/jniwrap/README.md @@ -101,9 +101,9 @@ Of course, real applications would read them from a file or other data source. -### compile the Main code +### Compile the Main code -we assume that PROJ was compiled with the right flag to support the bridge to Java +We assume that PROJ was compiled with the right flag to support the bridge to Java. Therefore we have a library called `proj.jar`. Thus we compile the `Main.java` with the command: @@ -113,4 +113,15 @@ and execute the created test case with: java --class-path .:<path to the jar library>/proj.jar -Djava.library.path=<path to the libproj, if needed> Main -That's it, enjoy! + + +### Troubleshooting + +If an `java.lang.UnsatisfiedLinkError` is thrown at execution time, add the following line in the Java code: + + System.out.println(System.getProperty("java.library.path")); + +Then verify that the `libproj.so` (Linux), `libproj.dylib` (MacOS) or `libproj.dll` (Windows) file is located +in one of the directories listed by above code. If this is not the case, then try configuring the +`LD_LIBRARY_PATH` (Linux), `DYLD_LIBRARY_PATH` (MacOS) or `PATH` (Windows) environment variable. +If the problem persist, adding the `-verbose:jni` option to the `java` command may help more advanced diagnostics. |
