-
-
Save zhm/1975726 to your computer and use it in GitHub Desktop.
Building GDAL 1.9 with MDB (PGeo) support on OS X Lion | |
- Download and install the "Java for Mac OS X 10.7 Update 1 Developer Package" from https://developer.apple.com/downloads/index.action | |
- Download jackcess-1.2.6.jar from http://sourceforge.net/projects/jackcess/files/jackcess/1.2.6/jackcess-1.2.6.jar/download | |
- Download http://mdb-sqlite.googlecode.com/files/mdb-sqlite-1.0.2.tar.bz2 to get commons-lang-2.4.jar and commons-logging-1.1.1.jar. They will go alongside jackcess in the $CLASSPATH after it builds. | |
- In the GDAL source root, edit the configure.in and replace it with https://gist.github.com/1975654 | |
- In the GDAL source root, run ./autogen.sh to re-create the configure script | |
- ./configure --with-java=yes --with-mdb=yes --with-jvm-lib=/System/Library/Frameworks/JavaVM.framework/Libraries | |
- make && make install (I suggest a custom --prefix with ./configure so you don't conflict with other versions of GDAL, e.g. homebrew) | |
- Copy jackcess-1.2.6.jar, commons-lang-2.4.jar, and commons-logging-1.1.1.jar to /Library/Java/Extensions so java can find them. | |
- Test it out ./ogr2ogr -f "SQLite" ~/data/test_output.sqlite ~/data/test_input.mdb |
What's in that directory? The configure script checks that there's an 'include' directory.
ls -al `/usr/libexec/java_home`
lrwxr-xr-x 1 root wheel 79 Mar 4 17:21 /usr/libexec/java_home -> /System/Library/Frameworks/JavaVM.framework/Versions/Current/Commands/java_home
/usr/libexec/java_home
returns /Library/Java/JavaVirtualMachines/1.6.0_29-b11-402.jdk/Contents/Home on my machine, which does have the include directory
On line 3351 of configure.in:
with_java=`/usr/libexec/java_home`
You can try hardcoding this just to get it to work, I haven't completely figured out how the java config works, but it seems java_home might be a different path on your machine.
So it would become something like:
with_java="/Library/Java/JavaVirtualMachines/1.6.0_29-b11-402.jdk/Contents/Home"
Go to that path on your machine and see if there's an include directory, if so, that should be the right one.
If anyone else is interested, I based my configure.in changes on another project I found that does similar linking to java. This script seems more robust and I think the GDAL configure script should be re-worked to be closer to this one.
aiight. I think I'm rolling now - I installed javadeveloper_for_mac_os_x_10.7__11m3527.dmg from https://developer.apple.com/downloads/index.action?name=Java%20Developer and in Java Preferences.app and disabled 1.6.0_29-b11-402 where Name was Java SE 6 (System), leaving to remaining two entries without (System). Don't know how I got all jacked w/ Java there...
Sweet!
If you're on Yosemite, you'll can find Java http://osxdaily.com/2014/10/21/get-java-os-x-yosemite/
ran into this...researching.
checking whether we should include Java support... configure: error: "/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home is not a valid JDK."