| Summary: | Error during emerge libgtk-java-2.4.6-r1, jni/jg_jnu.h:8:17: jni.h: No such file or directory | ||
|---|---|---|---|
| Product: | Gentoo Linux | Reporter: | abcdefg <abcdefg> |
| Component: | [OLD] Development | Assignee: | Java team <java> |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | CC: | andrew |
| Priority: | High | ||
| Version: | unspecified | ||
| Hardware: | x86 | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Package list: | Runtime testing required: | --- | |
|
Description
abcdefg
2004-11-22 13:23:18 UTC
So the obvious problem is that jni.h isn't found. The far less obvious part is *why not*. On my system I have /opt/sun-jdk-1.4.2.04/include/jni.h /opt/blackdown-jdk-1.4.1/include/jni.h /usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.2/include/jni.h /usr/lib/mozilla/include/java/jni.h So my question to reporter would be: can you figure out whether or not you have similar things installed? I just re-ran that part of the build, and compared my -I flags to yours, and they're the same. What JDK do you have installed? AfC Sydney P.S. Karltk hasn't had a chance to import all the other ebuilds yet, so you might want to go to http://www.operationaldynamics.com/reference/software/gentoo/ and grab my tarball of the ebuilds there. It won't help this specific problem, but it'll give you the rest of java-gnome. AfC Sydney Thank you for your help, At first I had only installed blackdown-jre and blackdown-jdk. After I installed sun-jdk (and set it als the default with java-config) the problem isn't solved. The jni.h files on my system are: locate jni.h /opt/sun-jdk-1.4.2.06/include/jni.h /opt/blackdown-jdk-1.4.1/include/jni.h /usr/lib/mozilla/include/java/jni.h There isn't a jni.h file in /usr/lib/gcc-lib/i386-pc-linux-gnu/3.3.4/include/ Could this be the problem? I think I have the same jdks as you. This is my gcc version: sys-devel/gcc-3.3.4-r1 Also i386-pc-linux-gnu is the only diretory in gcc-lib. Thank you for your time. David, Hoogeveen ;) I poked around the upstream source tree, and found that in the autoconf macros a reference to a check for jni.h ... which is commented out. So I uncommented it, and tried it, and the check comes back with "no" (jni.h not found), which is obvisouly wrong. However, that's just the bog standard autoconf check for such a thing, and upstream doesn't do anything with it regardless.
What needs to happen is that one of the installed jni.h files needs to end up on cc's include path. As a workaround, you can achieve that in one of two ways
a) you need a -I/opt/sun-jdk-1.4.2.04/include argument to your compiler command lines. Looking around more, I found in src/Makefile a reference to a variable JAVA_INCLUDES, which isn't set to anything. If you manually add that -I flag to line 43 of /var/tmp/portage/libgtk-java-2.4.6-r1/work/libgtk-java-2.4.6/src/Makefile (or wherever) then you should be able to build.
b) Re-build gcc with Java support, ie
USE=gcj emerge gcc
That will get you the fourth jni.h listed above, and that is on the system include path, and you'll be able to build. [One kinda has to wonder what results we've been getting building things with GCJ's jni.h and then running things with standard Java JREs, but hey, it works]
Obviously the ebuild shouldn't need to depend absolutely on the presence of GCJ, so I'll see if I can dream up a patch to the autoconf macros and src/Makefile to automate this. Something along the lines of
-I`java-config -O`/include
might do it
I'll also talk with upstream about this. Let me know how you get on.
AfC
Sydney
After recompiling gcc with gcj support libgtk-java installs fine! Also I tried the ebuilds from http://www.operationaldynamics.com/reference/software/gentoo/ because I want to make java/glade programs and there was a little (with an easy work around) bug in libglade-java, I posted a bug: http://bugs.gentoo.org/show_bug.cgi?id=72630. Thanks, David I had a word with upstream, and they're of the opinion that finding jni.h is a distro responsibility. Uh huh. Whatever. I'll incorporate the fix alluded to in #4 at some point; for now, the workaround is "just use a gcc build with GCJ enabled". AfC Singapore added a patch to set JAVA_INCLUDES when not using gcj |