Pljava methods to enable Postgresql access to installed Sword modules via the JSword library.

gogsadmin 2739d0f26b Update 'Readme.md' před 8 měsíci
lib d19244bb94 ensure lib dir present před 2 roky
src 492db7ca77 Fix #4 - rectify parsing of elements and text to render punctuation and parentheses correctly před 2 roky
Readme.md 2739d0f26b Update 'Readme.md' před 8 měsíci
pljava.policy 86cd7e8fe2 fix lib version mismatch and restrict java policy as much as possible před 2 roky
pom.xml 20e6ad4ebe update patch version před 2 roky

Readme.md

Installation

pljava

Build requirements:

  • libpq-dev
  • libkrb5-dev
  • postgresql-server-dev-15
  • openjdk-17-jdk-headless

Install the postgresql repo

On a debian system:

sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
sudo apt-get update
sudo apt-get -y install postgresql

See the postgresql documentation for other systems: https://www.postgresql.org/download/

Install the build requirements

On a debian system:

apt install libpq-dev libkrb5-dev postgresql-server-dev-15 openjdk-17-jdk-headless

Build pljava

git clone https://github.com/tada/pljava.git
git checkout V1_6_6
mvn clean install

Install pljava into postgresql server

See the pljava documentation: https://tada.github.io/pljava/install/install.html

java -jar pljava-packaging/target/pljava-pgX.jar

Install the extension

As postgres user, connect to the database for which you wish to enable pljava extension. In this example, the database is pljavadb

Create role and extension:

CREATE ROLE pljavarole;
CREATE EXTENSION pljava;

Apply ACLs

GRANT USAGE ON LANGUAGE java TO pljavarole;
ALTER DATABASE pljavadb SET pljava.libjvm_location TO '/usr/lib/jvm/java-11-openjdk-arm64/lib/server/libjvm.so';

pljava JSword

Dependencies:

  • slf4j
  • jdom2
  • jsword 2.1

Build pljava JSword

  • Assuming building as user pljava
  • Assuming git checkout in /home/pljava/pljava-jsword.git/
  • Assuming install location of /home/pljava/bin/

    cd ~/pljava-jsword.git
    mvn clean package
    mkdir ~/bin
    cp target/pljava-jsword-0.1.1-SNAPSHOT.jar ~/bin
    

Copy the slf4j, jdom2 and jsword jar files to ~/bin.

  • These will be found in the maven cache ~/.m2

Install pljava JSword

As postgres user, connect to pljavadb

Run SQL:

SELECT sqlj.remove_jar ('slf4j_logger', 'true');
SELECT sqlj.remove_jar ('jsword', 'true');
SELECT sqlj.remove_jar ('jdom2', 'true');
SELECT sqlj.remove_jar ('pljava_jsword', 'true');
SELECT * FROM sqlj.install_jar('file:///home/pljava/bin/jsword-2.1-SNAPSHOT.jar', 'jsword', 'false');
SELECT * FROM sqlj.install_jar('file:///home/pljava/bin/slf4j-api-1.7.36.jar', 'slf4j_logger', 'false');
SELECT * FROM sqlj.install_jar('file:///home/pljava/bin/jdom2-2.0.6.1.jar', 'jdom2', 'false');
SELECT sqlj.set_classpath('public', 'slf4j_logger:jsword:jdom2');
SELECT * FROM sqlj.install_jar('file:///home/pljava/bin/pljava-jsword-0.1.1-SNAPSHOT.jar', 'pljava_jsword', 'true');
SELECT sqlj.set_classpath('public', 'slf4j_logger:jsword:jdom2:pljava_jsword');