[cmake-developers] Improve JNI detection and fix Java testcase

Andreas Schneider asn at cryptomilk.org
Tue Mar 26 09:40:13 EDT 2013


On Tuesday 26 March 2013 08:30:25 Brad King wrote:
> On 03/18/2013 02:59 PM, Andreas Schneider wrote:
> > I've created two patches. The first improves the JNI find module to run
> > the
> > java executable to determine the home. The seconds uses the find module to
> > detect jni for the Java testcase correctly.
> > 
> > You can find it here:
> > 
> > http://cmake.org/gitweb?p=stage/cmake.git;a=shortlog;h=refs/heads/fix_java
> > _test
> Will your new code that runs JAVA_EXE tolerate a cross-compiling case
> where the exe cannot actually run on the host?

If you point it to the right java executable the java executable should return 
the correct details.

There is still a lot more which should be done. The JAVE_HOME variable is 
normally the path to be used. It should take precedence over everything else. 
If you have several java installations that's the one which tells the 
programs/tools which to use.

Currently we don't really honor that and all path are hardcoded and so only a 
limit number of java installations are considered.

I think FindJava.cmake and FindJNI.cmake need to be carefully rewritten 
looking for java binaries and FindJNI.cmake should use FindJava.cmake.

So this patch just fixes the default case for openSUSE and Fedora (with 
OpenJDK).


	-- andreas

-- 
Andreas Schneider                   GPG-ID: F33E3FC6
www.cryptomilk.org                asn at cryptomilk.org




More information about the cmake-developers mailing list