1
我在Ubuntu上安装PL /用java:PL/Java的 - 用户功能执行错误
sudo apt-get install postgresql-9.1-pljava-gcj
,但遇到了阻碍,我认为是罐子和PL/Java之间的一个GCJ/JDK 1.7不兼容。这些都是从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;
我们很高兴,直到执行:
SELECT hello('world');
生成该错误:
错误:java.lang.ClassFormatError:沙盒。 PLJava(无法识别的类文件版本) SQL状态:XX000
该jar是用标准的eclipse/export to jar(jdk 1.7.0)。
任何人都在此之前旅行?提前致谢。
你的java代码在PostgreSQL之外工作吗? –