I've been searching for ways to use java bindings for GDAL and installed the OSGeo4W packages QGIS
, GDAL
, and GrassGIS
using the "Express Desktop Install" method.
After installing and confirming the GDAL commands functioning in the OSGeo4W Shell, I do not see the gdal-java package and all of its contents that osgeo.org says it should here. The package should include the Java SWIG bindings for GDAL/OGR
and osgeo4w\lib\gdal.jar
.
I have the following Windows Environment Variables set up:
GDAL_DATA set to C:\OSGeo4W64\share\gdal
GDAL_DRIVER_PATH set to C:\OSGeo4W64\bin\gdalplugins
appended C:\OSGeo4W64\bin to PATH
Has the gdal-java
package depreciated? (considering the web pages have been updated 7-10 years ago) If so, is there another way of installing GDAL Java bindings easily?
Computer specs: Windows 10 x64
Best Answer
From what I have found, the gdal-java package is not included in the OSGeo4W installation. Sadly, there seems to be no easy way to install the bindings. The steps I've followed are found in this stack exchange question: GDAL Java bindings GDAL 2.0.0 in Eclipse
How I got the GDAL Java Bindings working for Windows
Test to see if GDAL is installed by opening Command Prompt and type in:
Copy and paste the following dlls from C:\Program Files\GDAL into your Java JDK bin folder (example: C:\Program Files\Java\jdk1.8.0_171\bin)
Within Netbeans or Eclipse, add the gdal.jar file from C:\Program Files\GDAL\java to your java project library.
For IntelliJ Idea: File->Project Structure