Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

problem with libswt-gtk2-support-2.1.1-4

Help
francois
2004-10-21
2013-04-16
  • francois
    francois
    2004-10-21

    I need to install libswt-gtk2-support-2.1.1-4 but when I do ./configure I get this error :
    checking jni.h usability... no
    checking jni.h presence... no
    checking for jni.h... no
    configure: error: Can't find jni.h
    I'm just starting with linux and don't know how I can resolve this error.
    thanks to help me.
    francois

     
    • McKenzie Keith
      McKenzie Keith
      2004-10-26

      The error means that ./configure couldn't find your file, jni.h.

      Which most likely means that gcc can't find it, which means that java support isn't properly configured. Don't worry, we can solve the problem.

      Step one is to make sure java works. Can you compile and run HelloWorld.java using gcj?

      HelloWorld.java looks like this:

      public class HelloWorld {
          public static void main(String [] args) {
            System.out.println("Hello, world");
          }
        }

      And  you compile like this:

      gcj -o HelloWorld --main=HelloWorld HelloWorld.java

      Then run HelloWorld:

      % ./HelloWorld

      If you are missing gcj, or it doesn't work correctly, fix that problem first.

      If you do have gcj, and you can compile and run HelloWorld, move on to the next step, which is to find jni.h.

      You can try this:
      % locate jni.h

      If that doesn't find it, try this:

      % find / -type f -name jni.h

      If you have jni.h somewhere, this will evetnually find it for sure.

      On my machine jni.h is in /usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.2/include

      You will most likely have something different.

      Anyway, now re-run configure like this:

      CFLAGS="/usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.2/include" ./configure

      Only, where I put in the path to my jni.h, you should put in the path to yours.

      Note that you shouldn't have to do this if gcj and gcc are installed properly (I don't have to do it). Gcc should know where to look for jni.h without being told.

      Let me know how it works out.

      Also, I would like to know what linux distribution you are using, just out of curiosity.

      --McKenzie

       
    • McKenzie Keith
      McKenzie Keith
      2004-10-26

      OOPS.

      I messed up on the CFLAGS. There should be a"-I" in front of the path, like this:
      % CFLAGS="-I/usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.2/include" ./configure

      Sorry!

      --McKenzie

       
    • francois
      francois
      2004-10-28

      I tryed your solution. And I use a mandrake 10 distribution.
      I do have a jni.h file in /usr/include/libgcj-3.3.2.
      and when I try CFLAGS="-I/usr/include/libgcj-3.3.2" ./configure I have now some new errors and 2 warnings :

      configure: WARNING: jni.h: accepted by the compiler, rejected by the preprocessor!
      configure: WARNING: jni.h: proceeding with the compiler's result

      checking for gtk+-2.0 >= 2.0... Package gtk+-2.0 was not found in the pkg-config search path.
      Perhaps you should add the directory containing `gtk+-2.0.pc'
      to the PKG_CONFIG_PATH environment variable
      No package 'gtk+-2.0' found

      configure: error: Library requirements (gtk+-2.0 >= 2.0) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them.

      I don't know if you can help me with this.
      thanks
      Francois.

       
    • McKenzie Keith
      McKenzie Keith
      2004-10-28

      Francois wrote:

      > configure: WARNING: jni.h: accepted by the compiler, rejected by the preprocessor!
      > configure: WARNING: jni.h: proceeding with the compiler's result

      I haven't seen this before. For now, let's ignore it and see if we can deal with the other problem.

      > configure: error: Library requirements (gtk+-2.0 >= 2.0) not met;

      What this means is that when configure tried executing pkg-config looking for information about gtk+-2.0, it failed. This can happen for two reasons that I know of:
      1) gtk+-2.0 is not properly installed
      2) gtk+-2.0 is installed, but the package configuration information is in a special directory.

      Here is how you can differentiate between case 1 and case 2.

      You can try to find the configuration file using "locate" or "find".

      The filename is "gtk+-2.0.pc".

      If you find the file, then you are probably in case 1, meaning that gtk+-2.0.pc is in a special directory. To work around this, set the environment variable PKG_CONFIG_PATH to the directory where the file is, and re-run configure. Like this:

      $ PKG_CONFIG_PATH="/usr/opt/gnome/lib" ./configure

      or

      $ export PKG_CONFIG_PATH="/usr/opt/gnome/lib"
      $ ./configure

      Of course, change /usr/opt/gnome/lib to the directory where you find the file "gtk+-2.0.pc".

      Now, at least, configure should find the .pc file. As long as the version is correct their should be no problem.

      If you don't find the file, then you are probably in case 2. I mean gtk+-2.0 is probably not installed.

      Libswt needs gtk+-2.0, so you must install it before you continue.

      Let me know what happens!

      --McKenzie

       
    • McKenzie Keith
      McKenzie Keith
      2004-10-28

      OOPS!

      I think I reversed my references to case 1 and case 2. Sorry!

      --McKenzie