MantisBT - CMake
View Issue Details
0012878CMakeModulespublic2012-01-17 12:552012-11-05 14:33
Dan Kegel 
Rolf Eike Beer 
normalminoralways
closedfixed 
LinuxUbuntu12.04
CMake 2.8.7 
CMake 2.8.9CMake 2.8.9 
0012878: find_package(Java) gives warning "regex not supported" again
Java.cmake has a hard-coded regex to parse java version strings, and it did
not expect 'icedtea' to appear in them.

It did seem to expect 'oem' to appear in them, so blindly piggyback on that
to add 'icedtea'. (Since a character class is used, it would also support
-tie-me-a-code and other anagrams, but fixing that is best done by
the author of that regex if desired.)

See attached patch.
Same as for bug 11676, but on latest ubuntu (12.04) with latest jdk (openjdk-7-jdk).
Exact log:

CMake Warning at /usr/local/cmake/share/cmake-2.8/Modules/FindJava.cmake:120 (message):
  regex not supported: java version "1.7.0_147-icedtea"

  OpenJDK Runtime Environment (IcedTea7 2.0) (7~b147-2.0-1ubuntu2)

  OpenJDK 64-Bit Server VM (build 21.0-b17, mixed mode). Please report
No tags attached.
patch icedtea.patch (845) 2012-01-17 12:56
https://public.kitware.com/Bug/file/4193/icedtea.patch
Issue History
2012-01-17 12:55Dan KegelNew Issue
2012-01-17 12:56Dan KegelFile Added: icedtea.patch
2012-06-25 08:32David ColeNote Added: 0029824
2012-06-25 08:33David ColeNote Added: 0029825
2012-06-25 09:11Rolf Eike BeerNote Added: 0029826
2012-06-25 10:46David ColeNote Added: 0029827
2012-06-25 12:55Rolf Eike BeerNote Added: 0029828
2012-06-25 12:55Rolf Eike BeerAssigned To => Rolf Eike Beer
2012-06-25 12:55Rolf Eike BeerStatusnew => resolved
2012-06-25 12:55Rolf Eike BeerResolutionopen => fixed
2012-06-25 12:55Rolf Eike BeerFixed in Version => CMake 2.8.9
2012-06-25 12:55Rolf Eike BeerTarget Version => CMake 2.8.9
2012-11-05 14:33David ColeNote Added: 0031460
2012-11-05 14:33David ColeStatusresolved => closed

Notes
(0029824)
David Cole   
2012-06-25 08:32   
Is the attached patch correct?

Do we have to match "oem" without matching "icedtea-oem" on some platforms?

(i.e. -- should the "icedtea-" be *separately* optional from the "oem-"?)
(0029825)
David Cole   
2012-06-25 08:33   
Oh, never mind. I see the comment about the character class now...

Maybe it's better fixed by just leaving that section of the reg ex as ".*" to match anything there...?
(0029826)
Rolf Eike Beer   
2012-06-25 09:11   
I think the best regex is really

 [0-9]+\\.[0-9]+\\.[0-9_.]+.*

i.e. allowing anything after the number. This is only used for Jave_VERSION_STRING which may contain more or less arbitrary content anyway.
(0029827)
David Cole   
2012-06-25 10:46   
Eike,

The regex you propose in http://cmake.org/Bug/view.php?id=12878#c29826 [^] sounds reasonable to me. As long as we can extract the numerical portions of the string for version comparisons down to the patch level, I think that's good.

Any reason not to just do that?

I can probably do it later today if we're agreed it's the best fix.
(0029828)
Rolf Eike Beer   
2012-06-25 12:55   
I'm all for it. I just have not touched it because I thought that stuff had a reason for being there in the first place. Looks like it doesn't.

Fix pushed to next:

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=304562e7b51d17735f8e8980e028a00d88b6d1ea [^]
(0031460)
David Cole   
2012-11-05 14:33   
Closing resolved issues that have not been updated in more than 4 months.