I installed pl/java on Ubuntu with:
sudo apt-get install postgresql-9.1-pljava-gcj
but have hit a snag which I think is a gcj/jdk 1.7 incompatibility between the jar and pl/java. These are the steps used with guidance from http://www.javacodegeeks.com/2012/10/introduction-to-postgresql-pljava.html:
select sqlj.install_jar('file:///home/me/temp/testJar.jar', 'sandbox', true);
select sqlj.set_classpath('public', 'sandbox');
CREATE FUNCTION public.hello(varchar) RETURNS varchar
AS 'sandbox.PLJava.hello'
LANGUAGE java;
We're happy until execution:
SELECT hello('world');
Which generates this error:
ERROR: java.lang.ClassFormatError: sandbox.PLJava (unrecognized class file version) SQL state: XX000
The jar was made with a standard eclipse/export to jar (jdk 1.7.0).
Anyone travel this road before? Thanks in advance.