Call the implementation method of GDAL DLL in Java
- 2020-04-01 01:59:37
- OfStack
Steps:
1. Compile GDAL (ignored during compilation).
2. Copy the compiled dynamic link library to the directory {JAVA_HOME}\jre\bin, as shown below:
< img Alt = "" border = 0 SRC =" / / files.jb51.net/file_images/article/201305/201305160845382.jpg "width = 900 height = 515 >
3. Introduce the compiled gdal.jar into the Java project and test it. The code is as follows:
@Override
protected boolean doIsAvailable() throws Throwable {
System.loadLibrary("gdaljni");
return true;
}
The code above determines whether gdal is available.