I have been struggling to install PL/Java on Postgres (9.2,9.3, or 9.4) on OpenSuse, Mageia, or Manjaro...I don't like to complain -but the PL/Java documentation is horrible. And I've googled installation help for 2+weeks now, with little progress...
Does anyone know how to complete this install? If so, could you please enlighten the world with this unspoken secrete!
Here is the general form followed:
Step 1-3 are well documented and self explanatory, 4 seems straight forward, but it's step 5 where I can't seem to make any headway...
To install/what has been tried:
4 Move pljava.jar and pljava.so files (constructed from Maven) to some location, say:
/usr/lib/postgresql
5.1 Create a postgres.conf file, and place inside /etc/ld.so.conf.d/ with contents:
/usr/lib/jvm/jdk1.7.0_79/jre/lib
/usr/lib/jvm/jdk1.7.0_79/jre/lib/i386/server
5.2 Update postgresql.conf file inside /usr/share/postgres93/data/ with the following additions:
pljava.classpath = '/usr/lib/postgresql/pljava.jar'
5.3 Run install.sql script on database(lets say postgres -since it exists OOTB)
psql -d postgres -f /somelocation/install.sql
From what little information I can find, this should be all that is required, but I get the following error while executing the install.sql.
psql:/home/pljava/install.sql:6: ERROR: could not access file "pljava": No such file or directory
psql:/home/pljava/install.sql:8: ERROR: function sqlj.java_call_handler() does not exist
psql:/home/pljava/install.sql:12: ERROR: could not access file "pljava": No such file or directory
psql:/home/pljava/install.sql:14: ERROR: function sqlj.javau_call_handler() does not exist
CREATE TABLE
GRANT
CREATE TABLE
GRANT
CREATE TABLE
GRANT
CREATE TABLE
GRANT
CREATE TABLE
GRANT
psql:/home/pljava/install.sql:59: ERROR: language "java" does not exist
psql:/home/pljava/install.sql:63: ERROR: language "java" does not exist
psql:/home/pljava/install.sql:67: ERROR: language "java" does not exist
psql:/home/pljava/install.sql:71: ERROR: language "java" does not exist
psql:/home/pljava/install.sql:75: ERROR: language "java" does not exist
psql:/home/pljava/install.sql:79: ERROR: language "java" does not exist
psql:/home/pljava/install.sql:83: ERROR: language "java" does not exist
psql:/home/pljava/install.sql:87: ERROR: language "java" does not exist
psql:/home/pljava/install.sql:91: ERROR: language "java" does not exist
Any ideas? This looks like it may be a java classpath issue?
After some time of trial and error. It looks like there is nothing wrong the with process above, except for the location of of pljava.so and pljava.jar.
I had poorly assumed that /usr/lib/postgres a good enough location, but it was not the correct location. Instead it needs to be inside the postgres lib directory! (which makes sense).
After I moved both pljava.so and pljava.jar into the /usr/lib/postgresql/lib directory, it magically worked.