Menu

#238 Package build JDK detection should see beyond symlinks

v1.1
closed
Build (18)
5
2012-09-24
2012-04-23
No

Because of the current (too basic) detection of the JDK location, we get such errors when trying to build the package:
../tmpjar/net/jankenpoi/sudokuki/generator/suexg/net_jankenpoi_sudokuki_generator_suexg_SuexgProxy.h:2:17: fatal error: jni.h: No such file or directory

The detection logs shows that the JDK utilities are detected but not beyond the symlinks that point to them:
checking for JAVA_HOME... not set
checking for javac... /usr/bin/javac
configure: Checking whether /usr is a valid JAVA_HOME for a JDK...
checking for javac... /usr/bin/javac
checking for javah... /usr/bin/javah
checking for java... /usr/bin/java
checking for jar... /usr/bin/jar

On my system (Debian Wheezy), the actual JDK location is:
/usr/lib/jvm/java-6-openjdk-i386/

=== using command 'readlink' should help fix this issue ===
sylvain@debian:~/Téléchargements/sudokuki-1.1.2$ readlink /usr/bin/javac
/etc/alternatives/javac
sylvain@debian:~/Téléchargements/sudokuki-1.1.2$ readlink /etc/alternatives/javac
/usr/lib/jvm/java-6-openjdk-i386/bin/javac
sylvain@debian:~/Téléchargements/sudokuki-1.1.2$ readlink /usr/lib/jvm/java-6-openjdk-i386/bin/javac
sylvain@debian:~/Téléchargements/sudokuki-1.1.2$

It is to say:
/usr/bin/javac -> /etc/alternatives/javac -> /usr/lib/jvm/java-6-openjdk-i386/bin/javac

PROPOSED SOLUTION:
=> try using readlink to replace symbolic links with the actual Java utility it points to.

Discussion

  • Sylvain Vedrenne

    WORKAROUND: use passing JAVA_HOME to the configure script to avoid the above issue.

     
  • Sylvain Vedrenne

    WORKAROUND: use passing JAVA_HOME to the configure script to avoid the
    above issue. The below commands illustrate this workaround. Do this if /usr/lib/jvm/java-6-openjdk-i386/ is the location of your JDK:

        ./configure JAVA_HOME=/usr/lib/jvm/java-6-openjdk-i386/
        make
    

    should work.

     
  • Sylvain Vedrenne

    Fixed in release 1.1.3 (using 'readlink -f').

     

Log in to post a comment.