From: Steve Jones
Date: Fri Nov 14 15:40:34 2008
Subject: [greenstone-users] Problem compiling from src - javagdbm on OSX
In reply to: 153957d20811031615i343bf158x43df2905f3ae26ca-mail-gmail-com

> [exec] configure: error: not found in $JAVA\_HOME
> [exec] checking for the JDK...
> [exec] Result: 1

Scott

I have just done a build under OS X 10.5.5 on an Intel machine with

JAVA\_HOME=/Library/Java/Home/

and

$ which java
/Library/Java/Home/bin/java

and

$ java -version

java version "1.5.0\_16"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0\_16-
b06-284)
Java HotSpot(TM) Client VM (build 1.5.0\_16-133, mixed mode, sharing)


I built the source checked out with

svn co http://svn.greenstone.org/greenstone3/trunk greenstone3

in two stages

ant prepare
ant install

I get warnings, but not errors for javagdbm compilation (see below)
There is an error when compiling wvWare (see below)

I suspect that your JAVA\_HOME environment variable isn't correctly
set, or /Library/Java/Home doesn't have the full content.

I think that the config script for javagdbm checks that JAVA\_HOME
- is not blank
- is set to a directory
- has an subdirectory called 'include'

At what point in the compile sequence for javagdbm shown below do you
get the failure?

Cheers
Steve

\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_
Steve Jones
Associate Professor, Computer Science
University of Waikato
Private Bag 3105
Hamilton, New Zealand
stevej@cs.waikato.ac.nz

compile-packages:
[echo] compile javagdbm
[exec] for subdir in java jni; do \\
[exec] echo making all in $subdir; \\
[exec] (cd $subdir && /usr/bin/make all) || exit 1; \\
[exec] done
[exec] making all in java
[exec] mkdir -p ./classes
[exec] /Library/Java/Home//bin/javac -d ./classes -sourcepath . -
deprecation -g -O au/com/pharos/*/*.java
[exec] au/com/pharos/gdbm/GdbmFile.java:161: warning:
[deprecation] runFinalizersOnExit(boolean) in java.lang.System has
been deprecated
[exec] System.runFinalizersOnExit(true);
[exec] ^
[exec] au/com/pharos/packing/NativeStringPacking.java:62:
warning: [deprecation] getBytes(int,int,byte[],int) in
java.lang.String has been deprecated
[exec] str.getBytes(0, len, rawArray, 0);
[exec] ^
[exec] au/com/pharos/packing/NativeStringPacking.java:79:
warning: [deprecation] String(byte[],int) in java.lang.String has been
deprecated
[exec] return new String(raw, 0);
[exec] ^
[exec] Note: Some input files use unchecked or unsafe operations.
[exec] Note: Recompile with -Xlint:unchecked for details.
[exec] 3 warnings
[exec] /Library/Java/Home//bin/javah -o ..//jni/GdbmFile.h -
classpath ./classes: au.com.pharos.gdbm.GdbmFile
[exec] /Library/Java/Home//bin/jar cf ..//javagdbm.jar -C ./
classes au
[exec] making all in jni
[exec] gcc -I. -I/Library/Java/Home//include -I/Users/stevej/tmp/
greenstone3/src/packages/gdbm-1.8.3/include -I/System/Library/
Frameworks/JavaVM.framework/Headers/ -c -Wall -O2 -fpic -I. -I/
Library/Java/Home//include -I/Users/stevej/tmp/greenstone3/src/
packages/gdbm-1.8.3/include -I/System/Library/Frameworks/
JavaVM.framework/Headers/ -DWRAPPER\_VERSION=\\"0005\\" gdbmjava.c
[exec] gdbmjava.c:1: warning: -fpic is not supported; -fPIC
assumed
[exec] gdbmjava.c: In function ?datumToArray?:
[exec] gdbmjava.c:375: warning: pointer targets in passing
argument 5 of ?(*env)->SetByteArrayRegion? differ in signedness
[exec] gdbmjava.c: In function ?arrayToDatum?:
[exec] gdbmjava.c:391: warning: pointer targets in assignment
differ in signedness
[exec] gdbmjava.c: In function ?releaseArray?:
[exec] gdbmjava.c:403: warning: pointer targets in passing
argument 3 of ?(*env)->ReleaseByteArrayElements? differ in signedness
[exec] gdbmjava.c: In function ?releaseArrayAbort?:
[exec] gdbmjava.c:414: warning: pointer targets in passing
argument 3 of ?(*env)->ReleaseByteArrayElements? differ in signedness
[exec] gcc -dynamiclib -fno-common -single\_module -framework
JavaVM -o libgdbmjava.jnilib gdbmjava.o -L/Users/stevej/tmp/
greenstone3/src/packages/gdbm-1.8.3/lib -lgdbm
[exec] for subdir in java jni; do \\
[exec] echo making install in $subdir; \\
[exec] (cd $subdir && /usr/bin/make install) || exit 1; \\
[exec] done
[exec] making install in java
[exec] make[1]: Nothing to be done for `install'.
[exec] making install in jni
[exec] cp libgdbmjava.jnilib /Users/stevej/tmp/greenstone3/lib/
jni/
[echo] Windows: compile javagdbm (java only)
[echo] Install the javagdbm jar file
[copy] Copying 1 file to /Users/stevej/tmp/greenstone3/lib/jni


[exec] gcc -o wvWare wvWare.o -L. -lwv -lz -liconv -L/sw/
lib -lglib -lm -Wl,-multiply\_defined -Wl,suppress
[exec] Undefined symbols:
[exec] "\_iconv\_close", referenced from:
[exec] \_wvLIDToCodePageConverter in libwv.a(text.o)
[exec] \_wvLIDToCodePageConverter in libwv.a(text.o)
[exec] \_wvHandleCodePage in libwv.a(text.o)
[exec] \_wvHandleCodePage in libwv.a(text.o)
[exec] \_wvOutputFromUnicode in libwv.a(text.o)
[exec] "\_iconv", referenced from:
[exec] \_wvHandleCodePage in libwv.a(text.o)
[exec] \_wvHandleCodePage in libwv.a(text.o)
[exec] \_wvOutputFromUnicode in libwv.a(text.o)
[exec] \_wvOutputFromUnicode in libwv.a(text.o)
[exec] "\_iconv\_open", referenced from:
[exec] \_wvLIDToCodePageConverter in libwv.a(text.o)
[exec] \_wvLIDToCodePageConverter in libwv.a(text.o)
[exec] \_wvHandleCodePage in libwv.a(text.o)
[exec] \_wvHandleCodePage in libwv.a(text.o)
[exec] \_wvOutputFromUnicode in libwv.a(text.o)
[exec] ld: symbol(s) not found
[exec] collect2: ld returned 1 exit status
[exec] make[3]: *** [wvWare] Error 1
[exec] make[2]: *** [all] Error 1
[exec] make[1]: *** [all] Error 1
[exec] make: *** [all] Error 1