Opened 15 years ago

Closed 14 years ago

Last modified 14 years ago

#19951 closed defect (fixed)

db46 fails to build java bindings due to "missing" jni.h

Reported by: martin@… Owned by: blair (Blair Zajac)
Priority: Normal Milestone:
Component: ports Version: 1.7.1
Keywords: java-bindings include file missing Cc: acampbell3000@…
Port: db46

Description (last modified by mf2k (Frank Schima))

Hello,

several versions of the jdk are installed on my computer and jni.h is available. But it is not in the include path, so the following command fails:

/bin/sh ./libtool --mode=compile /usr/bin/gcc-4.0 -c -I. -I../dist/.. -I/opt/local/include -O2  -fno-strict-aliasing ../dist/../libdb_java/db_java_wrap.c /usr/bin/gcc-4.0 -c -I. -I../dist/.. -I/opt/local/include -O2 -fno-strict-aliasing ../dist/../libdb_java/db_java_wrap.c  -fno-common -DPIC -o .libs/db_java_wrap.o

../dist/../libdb_java/db_java_wrap.c:123:17: error: jni.h: No such file or directory

../dist/../libdb_java/db_java_wrap.c:147: error: syntax error before '*' token
[...]

My hotfix was to remove the line --enable-java from the ports file.

Regards,

Martin

Change History (14)

comment:1 Changed 15 years ago by mf2k (Frank Schima)

Description: modified (diff)
Owner: changed from macports-tickets@… to blair@…

comment:2 Changed 15 years ago by blair (Blair Zajac)

Which OS version are you using? Do you only have Apple's Java installed?

Can you include the output of the configure step that shows it looking for Java.

This works for all our Mac's and this is the first report of the Java bindings failing so it's something with your system. We won't be removing the --enable-java from the Portfile.

comment:3 in reply to:  2 Changed 15 years ago by martin@…

Replying to blair@…:

Which OS version are you using? Do you only have Apple's Java installed?

I use OSX 10.5.7 and java 1.5:

vanadium:~ $ 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)

Can you include the output of the configure step that shows it looking for Java.

I pasted it below.

This works for all our Mac's and this is the first report of the Java bindings failing so it's something with your system. We won't be removing the --enable-java from the Portfile.

Yes, sure. And I think there is something strange with my java installation, because my software update asks me every time if I want to install the "Java For Mac OS X 10.5 Update 2" Version 1.0.

vanadium:~ $ sudo port -v configure db46
--->  Fetching db46
--->  Verifying checksum(s) for db46
--->  Checksumming patch.4.6.21.1
--->  Checksumming patch.4.6.21.2
--->  Checksumming patch.4.6.21.3
--->  Checksumming db-4.6.21.tar.gz
--->  Extracting db46
--->  Extracting db-4.6.21.tar.gz
--->  Applying patches to db46
--->  Applying /opt/local/var/macports/distfiles/db4/4.6.21_5/patch.4.6.21.1
patching file dbinc/mp.h
patching file mp/mp_fopen.c
patching file mp/mp_sync.c
--->  Applying /opt/local/var/macports/distfiles/db4/4.6.21_5/patch.4.6.21.2
(Stripping trailing CRs from patch.)
patching file mp/mp_region.c
--->  Applying /opt/local/var/macports/distfiles/db4/4.6.21_5/patch.4.6.21.3
patching file sequence/sequence.c
--->  Configuring db46
checking build system type... i386-apple-darwin9.7.0
checking host system type... i386-apple-darwin9.7.0
checking if building in the top-level or dist directories... no
checking if --disable-cryptography option specified... no
checking if --disable-hash option specified... no
checking if --disable-mutexsupport option specified... no
checking if --disable-queue option specified... no
checking if --disable-replication option specified... no
checking if --disable-statistics option specified... no
checking if --disable-verify option specified... no
checking if --enable-compat185 option specified... no
checking if --enable-cxx option specified... yes
checking if --enable-debug option specified... no
checking if --enable-debug_rop option specified... no
checking if --enable-debug_wop option specified... no
checking if --enable-diagnostic option specified... no
checking if --enable-dump185 option specified... yes
checking if --enable-java option specified... yes
checking if --enable-mingw option specified... no
checking if --enable-fine_grained_lock_manager option specified... no
checking if --enable-o_direct option specified... no
checking if --enable-posixmutexes option specified... no
checking if --enable-pthread_api option specified... no
checking if --enable-rpc option specified... no
checking if --enable-smallbuild option specified... no
checking if --enable-tcl option specified... no
checking if --enable-test option specified... no
checking if --enable-uimutexes option specified... no
checking if --enable-umrw option specified... no
checking if --with-mutex=MUTEX option specified... no
checking if --with-tcl=DIR option specified... no
checking if --with-uniquename=NAME option specified... no
checking for chmod... chmod
checking for cp... cp
checking for ln... ln
checking for mkdir... mkdir
checking for rm... rm
checking for sh... /bin/sh
checking for a BSD-compatible install... /usr/bin/install -c
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables... 
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether /usr/bin/gcc-4.0 accepts -g... yes
checking for /usr/bin/gcc-4.0 option to accept ISO C89... none needed
checking for an ANSI C-conforming const... yes
checking for inline... inline
checking whether we are using the GNU C++ compiler... yes
checking whether /usr/bin/g++-4.0 accepts -g... yes
checking how to run the C++ preprocessor... /usr/bin/g++-4.0 -E
checking whether C++ supports the ISO C++ standard includes... yes
checking whether we are using gcc version 2.96... no
checking whether g++ requires -fhandle-exceptions... no
checking for a sed that does not truncate output... /opt/local/bin/gsed
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for ld used by /usr/bin/gcc-4.0... /usr/libexec/gcc/i686-apple-darwin9/4.0.1/ld
checking if the linker (/usr/libexec/gcc/i686-apple-darwin9/4.0.1/ld) is GNU ld... no
checking for /usr/libexec/gcc/i686-apple-darwin9/4.0.1/ld option to reload object files... -r
checking for BSD-compatible nm... /usr/bin/nm -p
checking whether ln -s works... yes
checking how to recognise dependent libraries... pass_all
checking how to run the C preprocessor... /usr/bin/cpp-4.0
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking dlfcn.h usability... yes
checking dlfcn.h presence... yes
checking for dlfcn.h... yes
checking how to run the C++ preprocessor... /usr/bin/g++-4.0 -E
checking for g77... no
checking for xlf... no
checking for f77... no
checking for frt... no
checking for pgf77... no
checking for cf77... no
checking for fort77... no
checking for fl32... no
checking for af77... no
checking for xlf90... no
checking for f90... no
checking for pgf90... no
checking for pghpf... no
checking for epcf90... no
checking for gfortran... no
checking for g95... no
checking for xlf95... no
checking for f95... no
checking for fort... no
checking for ifort... no
checking for ifc... no
checking for efc... no
checking for pgf95... no
checking for lf95... no
checking for ftn... no
checking whether we are using the GNU Fortran 77 compiler... no
checking whether  accepts -g... no
checking the maximum length of command line arguments... 196608
checking command to parse /usr/bin/nm -p output from /usr/bin/gcc-4.0 object... ok
checking for objdir... .libs
checking for ar... ar
checking for ranlib... ranlib
checking for strip... strip
checking if /usr/bin/gcc-4.0 supports -fno-rtti -fno-exceptions... no
checking for /usr/bin/gcc-4.0 option to produce PIC... -fno-common
checking if /usr/bin/gcc-4.0 PIC flag -fno-common works... yes
checking if /usr/bin/gcc-4.0 static flag -static works... no
checking if /usr/bin/gcc-4.0 supports -c -o file.o... yes
checking whether the /usr/bin/gcc-4.0 linker (/usr/libexec/gcc/i686-apple-darwin9/4.0.1/ld) supports shared libraries... yes
checking dynamic linker characteristics... darwin9.7.0 dyld
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
configure: creating libtool
appending configuration tag "CXX" to libtool
checking for ld used by /usr/bin/g++-4.0... /usr/libexec/gcc/i686-apple-darwin9/4.0.1/ld
checking if the linker (/usr/libexec/gcc/i686-apple-darwin9/4.0.1/ld) is GNU ld... no
checking whether the /usr/bin/g++-4.0 linker (/usr/libexec/gcc/i686-apple-darwin9/4.0.1/ld) supports shared libraries... yes
checking for /usr/bin/g++-4.0 option to produce PIC... -fno-common
checking if /usr/bin/g++-4.0 PIC flag -fno-common works... yes
checking if /usr/bin/g++-4.0 static flag -static works... no
checking if /usr/bin/g++-4.0 supports -c -o file.o... yes
checking whether the /usr/bin/g++-4.0 linker (/usr/libexec/gcc/i686-apple-darwin9/4.0.1/ld) supports shared libraries... yes
checking dynamic linker characteristics... darwin9.7.0 dyld
checking how to hardcode library paths into programs... immediate
appending configuration tag "F77" to libtool
checking SOSUFFIX from libtool... .dylib
checking MODSUFFIX from libtool... .so
checking JMODSUFFIX from libtool... .jnilib
checking for javac... javac
checking if javac works... yes
checking for jar... jar
checking for java... java
checking for uudecode... yes
checking if uudecode can decode base 64 file... yes
checking if java works... yes
checking for javac... /usr/bin/javac
checking absolute path of javac... /usr/bin/javac
checking symlink for /usr/bin/javac... /System/Library/Frameworks/JavaVM.framework/Versions/Current/Commands/javac
checking symlink for /System/Library/Frameworks/JavaVM.framework/Versions/Current/Commands/javac... /System/Library/Frameworks/JavaVM.framework/Versions/Current/Commands/../Home/bin/javac
checking java version... 1.5.0_16
checking whether stat file-mode macros are broken... no
checking whether time.h and sys/time.h may both be included... yes
checking for dirent.h that defines DIR... yes
checking for library containing opendir... none required
checking sys/select.h usability... yes
checking sys/select.h presence... yes
checking for sys/select.h... yes
checking sys/socket.h usability... yes
checking sys/socket.h presence... yes
checking for sys/socket.h... yes
checking sys/time.h usability... yes
checking sys/time.h presence... yes
checking for sys/time.h... yes
checking for struct stat.st_blksize... yes
checking for inttypes.h... (cached) yes
checking for stdint.h... yes
checking if stdint.h can be used by C++... yes
checking stddef.h usability... yes
checking stddef.h presence... yes
checking for stddef.h... yes
checking for unistd.h... (cached) yes
checking for char... yes
checking size of char... 1
checking for unsigned char... yes
checking size of unsigned char... 1
checking for short... yes
checking size of short... 2
checking for unsigned short... yes
checking size of unsigned short... 2
checking for int... yes
checking size of int... 4
checking for unsigned int... yes
checking size of unsigned int... 4
checking for long... yes
checking size of long... 4
checking for unsigned long... yes
checking size of unsigned long... 4
checking for long long... yes
checking size of long long... 8
checking for unsigned long long... yes
checking size of unsigned long long... 8
checking for char *... yes
checking size of char *... 4
checking for u_char... yes
checking for u_short... yes
checking for u_int... yes
checking for u_long... yes
checking for u_int8_t... yes
checking for u_int16_t... yes
checking for int16_t... yes
checking for u_int32_t... yes
checking for int32_t... yes
checking for u_int64_t... yes
checking for int64_t... yes
checking for FILE... yes
checking for off_t... yes
checking for pid_t... yes
checking for size_t... yes
checking for time_t... yes
checking for size_t... (cached) yes
checking size of size_t... 4
checking for ssize_t... yes
checking for uintmax_t... yes
checking for uintptr_t... yes
checking for socklen_t... yes
checking for ANSI C exit success/failure values... yes
checking for mutexes... x86/gcc-assembly
checking for library containing sched_yield... none required
checking for library containing fdatasync... no
checking for library containing getaddrinfo... none required
checking for library containing hstrerror... none required
checking for main in -lm... yes
checking for main in -lnsl... no
checking for main in -lpthread... yes
checking for main in -lsocket... no
checking for abort... yes
checking for atoi... yes
checking for atol... yes
checking for getcwd... yes
checking for getenv... yes
checking for getopt... yes
checking for isalpha... yes
checking for isdigit... yes
checking for isprint... yes
checking for isspace... yes
checking for memcmp... yes
checking for memcpy... yes
checking for memmove... yes
checking for printf... yes
checking for qsort... yes
checking for raise... yes
checking for rand... yes
checking for strcasecmp... yes
checking for strcat... yes
checking for strchr... yes
checking for strdup... yes
checking for strerror... yes
checking for strncat... yes
checking for strncmp... yes
checking for strrchr... yes
checking for strsep... yes
checking for strtol... yes
checking for strtoul... yes
checking for _fstati64... no
checking for directio... no
checking for fchmod... yes
checking for fclose... yes
checking for fcntl... yes
checking for fdatasync... no
checking for fgetc... yes
checking for fgets... yes
checking for fopen... yes
checking for fwrite... yes
checking for getaddrinfo... yes
checking for getrusage... yes
checking for gettimeofday... yes
checking for getuid... yes
checking for hstrerror... yes
checking for localtime... yes
checking for mprotect... yes
checking for pstat_getdynamic... no
checking for pthread_yield... no
checking for sched_yield... yes
checking for select... yes
checking for sigaction... yes
checking for snprintf... yes
checking for stat... yes
checking for strftime... yes
checking for sysconf... yes
checking for time... yes
checking for vsnprintf... yes
checking for yield... no
checking for ftruncate... yes
checking for clock_gettime... no
checking for ctime_r... yes
checking for 2 or 3 argument version of ctime_r... 2-argument
checking for pread... yes
checking for pwrite... yes
checking for fcntl/F_SETFD... yes
checking for special C compiler options needed for large files... no
checking for _FILE_OFFSET_BITS value needed for large files... no
checking for mlock... yes
checking for munlock... yes
checking for mmap... yes
checking for munmap... yes
checking for shmget... yes
checking for 64-bit integral type support for sequences... yes
configure: creating ./config.status
config.status: creating Makefile
config.status: creating db_cxx.h
config.status: creating db_int.h
config.status: creating clib_port.h
config.status: creating include.tcl
config.status: creating db.h
config.status: creating db_config.h
vanadium:~ $ 

comment:5 Changed 15 years ago by blair (Blair Zajac)

It does sound like something is messed up with your Java install.

There's an update that came out today that may fix the install. You could also try to reinstall Java from your Mac OS X CD/DVD and then try to update it.

The other thing to try is to tell your system to use Java 6 instead of 1.5. Set the preferences in

/Applications/Utilities/Java/Java Preferences.app

In any case, it sounds like this is an isolated case and we should just close the ticket.

comment:6 Changed 15 years ago by blair (Blair Zajac)

Is this working for you now?

comment:7 Changed 14 years ago by jmroot (Joshua Root)

Resolution: worksforme
Status: newclosed

No response; closing.

comment:8 in reply to:  7 Changed 14 years ago by giannim_89@…

Replying to jmr@…:

No response; closing.

i try the same procedure but, it don't working how can i do?

comment:9 Changed 14 years ago by giannim_89@…

Resolution: worksforme
Status: closedreopened

comment:10 Changed 14 years ago by blair (Blair Zajac)

You're going to have to do the debugging work to figure out why the jni.h is missing or cannot be found. The db46 port works for 98% of all MacPorts' users, so it's probably something with the install on your system. You'll have to figure out why and if there's an issue that the db46 can help with, then submit a patch.

comment:11 in reply to:  10 Changed 14 years ago by giannim_89@…

Replying to blair@…:

You're going to have to do the debugging work to figure out why the jni.h is missing or cannot be found. The db46 port works for 98% of all MacPorts' users, so it's probably something with the install on your system. You'll have to figure out why and if there's an issue that the db46 can help with, then submit a patch.

OOOK it works!!! thanks a lot

comment:12 Changed 14 years ago by blair (Blair Zajac)

Resolution: fixed
Status: reopenedclosed

comment:13 Changed 14 years ago by acampbell3000@…

Cc: acampbell3000@… added

Cc Me!

comment:14 in reply to:  10 ; Changed 14 years ago by bmguillory+macports@…

I had this same problem. I managed to fix it by downloading and installing javadeveloper_10.6_10m3261.dmg. I don't think that there is anything special about this particular package, it was just the current Java Developer package from Apple at the time. I believe that /System/Library/Frameworks/JavaVM.framework/Versions/Current/Headers/ and thus jni.h in that directory did not exist before, now it does.

comment:15 in reply to:  14 Changed 14 years ago by boris.dusek@…

Replying to bmguillory+macports@…:

I believe that /System/Library/Frameworks/JavaVM.framework/Versions/Current/Headers/ and thus jni.h in that directory did not exist before, now it does.

That is not the case for me. I did not install the javadeveloper* package, yet I do have the directory you mentioned and jni.h is in it. And yet db46 fails to build for me with the same error (compiler erroring first on jni.h not found and then an avalanche of errors).

Note: See TracTickets for help on using tickets.