JAVA_HOME not set

Forums:

Hello,

When i run waf configuration using --with-jni option, $JAVA_HOME is not found, although it is correctly binded to the path that actually contains /bin and /include, etc.

user@machine /opt/Ibex/ibex-2.1.10 $ echo $JAVA_HOME && ls $JAVA_HOME && echo $JAVA_HOME/include && ls  $JAVA_HOME/include
/usr/lib/jvm/java-7-openjdk-amd64
ASSEMBLY_EXCEPTION  docs     jre  man      THIRD_PARTY_README
bin                 include  lib  src.zip
/usr/lib/jvm/java-7-openjdk-amd64/include
classfile_constants.h  jawt_md.h        jni.h     jvmticmlr.h  linux
jawt.h                 jdwpTransport.h  jni_md.h  jvmti.h

user@machine /opt/Ibex/ibex-2.1.10 $ sudo ./waf configure --with-soplex=/opt/Ibex/soplex-1.7.1 --with-jni --with-java-package=solver.constraints.real

Setting top to                           : /opt/Ibex/ibex-2.1.10
Setting out to                           : /opt/Ibex/ibex-2.1.10/__build__
Checking for 'g++' (c++ compiler)        : /usr/bin/g++
Checking for 'gcc' (c compiler)          : /usr/bin/gcc
Checking for program bison               : /usr/bin/bison
Checking for program flex                : /usr/bin/flex
Checking for compiler flags -O3          : yes
Checking for compiler flags -Wno-deprecated : yes
set JAVA_HOME in the system environment
(complete log in /opt/Ibex/ibex-2.1.10/__build__/config.log)

I tried this using other Ibex versions (2.1.5, 2.1.7) and various jdk (java-6-openjdk-amd64, java-7-openjdk-amd64, jdk1.7.0_71).
I ran it on Ubuntu 14.04.1 LTS (Mint 17) using Linux 3.13.0-24-generic x86_64. I checked requirements (python 2.7.6 + others). Compilation runs well without the jni option. The config.log (see file) doesn't bring me more hints.

Would you have a solution ? I may have missed something evident, i can't find what. My goal is to use the Choco-Ibex jni bridge.

Thanks in advance,

Well, that was the evident thing : running ./waf with sudo cleanups environment variables, such as $JAVA_HOME.