Saturday, February 22, 2014

Building ZOO with Java on Ubuntu 12.04

I tried to build the ZOO WPS platform with Java support on Ubuntu 12.04 and it turned out to be not so easy. This is how I managed it with OpenJDK 7 (packages openjdk-7-jdk and openjdk-7-jre):
./configure LDFLAGS=-L/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/server --with-java=/usr/lib/jvm/java-7-openjdk-amd64
For unknown reasons the configuration writes wrong JAVALDFLAGS to the Makefile, thus the Makefile needs to be altered as follows. Replace the line where the JAVALDFLAGS are defined:
JAVALDFLAGS=-L/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/client/ -ljvm -lpthread
with
JAVALDFLAGS=-L/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/server/ -ljvm -lpthread
then follow the normal instructions with
make