[cmake-developers] [CMake 0014032]: Find_Java fails to prioritize JAVA_HOME

Mantis Bug Tracker mantis at public.kitware.com
Wed Mar 20 10:42:25 EDT 2013


The following issue has been SUBMITTED. 
====================================================================== 
http://public.kitware.com/Bug/view.php?id=14032 
====================================================================== 
Reported By:                Pol Monsó Purtí
Assigned To:                
====================================================================== 
Project:                    CMake
Issue ID:                   14032
Category:                   Modules
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     new
====================================================================== 
Date Submitted:             2013-03-20 10:42 EDT
Last Modified:              2013-03-20 10:42 EDT
====================================================================== 
Summary:                    Find_Java fails to prioritize JAVA_HOME
Description: 
FindJava.cmake chooses the vewest version of Java instead of the one pointed by
the environment variable JAVA_HOME.

If there are several versions and the user targets a particular one, there's no
way to tell cmake.

Steps to Reproduce: 
1. install several versions of jdk.
2. set JAVA_HOME to the oldest one
3. Run a cmake with Find(Java) and check the output

Additional Information: 
I could fix this by changing FindJava.cmake

from

set(_JAVA_HINTS
"[HKEY...]/bin"
[...]
$ENV{JAVA_HOME}/bin
)

to

set(_JAVA_HINTS
$ENV{JAVA_HOME}/bin
"[HKEY...]/bin"
[...]
)

====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2013-03-20 10:42 Pol Monsó PurtíNew Issue                                    
======================================================================




More information about the cmake-developers mailing list