[CMake] Java not found

Roger Leigh rleigh at codelibre.net
Tue Nov 20 03:36:12 EST 2018


On 20/11/2018 01:02, szukw000 wrote:
> cmake-3.12.4 did find the correct version:
> 
> -- Found Java: /usr/lib64/java/bin/java (found version "11.0.1")
> 
> But the cmake Module FindJava.cmake fails with this warning:
> 
> -----------------------------------------------------------
> warning: [options] bootstrap class path not set in conjunction with 
> -source 5
> error: Source option 5 is no longer supported. Use 6 or later.
> error: Target option 1.5 is no longer supported. Use 1.6 or later.

Java /was/ found correctly.  The problem is that Java 11 is not capable 
of compiling Java 5 (or 6, or 7) sources.  Java 11 can only compile Java 
8+ sources.

You need to either

- use an older JDK
- update the source and target versions to a minimum of 1.8

Since all the JDK versions supporting 1.5 are long out of support, I'd 
recommend the latter.  You might need some small source adjustments to 
fix up any obsolete feature removals or behaviour changes.


Regards,
Roger


More information about the CMake mailing list