简体   繁体   中英

Installing PL/Java on MAC

I'm really having trouble installing Pl/Java on Mac, any help would be appreciated.

I'll describe the exact steps I've done in accordance with the README here, but I still get some errors that I cannot resolve.

(1) I've downloaded this version: pljava-i686-pc-linux-gnu-pg9.0-1.4.2

(2) I've located three files in the directory: pljava.jar , deploy.jar , pljava.so

(3) I've put the two .jars inside: /Library/PostgreSQL/9.0/lib

(4) I've put the .so inside: /Library/PostgreSQL/9.0/data

(5) I've modified the postgresql.conf as follows:

dynamic_library_path = '$libdir'
custom_variable_classes = 'pljava'
pljava.classpath = '/Library/PostgreSQL/9.0/lib/pljava.jar’

(6) I've also tried:

dynamic_library_path = '$libdir:/Library/PostgreSQL/9.0/lib/'    (as well as...)
dynamic_library_path = '$libdir:/Library/PostgreSQL/9.0/data/'

(7) I then try to run:

Select sqlj.install_jar('/Software/Libraries/test_trigger.jar', 'samples', false);
Select sqlj.set_classpath(‘public’, ‘samples’);

Although, I keep getting this error:

WARNING:  java.lang.NoSuchMethodError: Method org.postgresql.pljava.internal.Portal._fetch(JZI)I not found

ERROR:  Unable to register native methods

********** Error **********

ERROR: Unable to register native methods
SQL state: XX000

This sounds like an issue is in not loading the right .jar. You mentioned in your comments that you were also having a problem with appropriate environment variables specifying where to load modules. This may in fact be your main issue. It looks like the equivalent environment variable is DYLD_LIBRARY_PATH though you can get more options by looking at man dyld and obviously if you are loading the wrong .so or .jar you will get errors like this.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM