CMake can't find Java because of Cygwin

199 Views Asked by At

A user of my software is running Windows with Cygwin installed, which provides access to the standard GNU which command. In my CMakeLists.txt there is a line that reads:

FIND_PACKAGE( JAVA REQUIRED CONFIG )

This fails on his machine, because both JAVAConfig.cmake and java-config.cmake (executed by FIND_PACKAGE) use this command as a first-line attack in locating Java. The command returns a bad path to a non-existent install of Java. What can I do to override this annoying behavior from my CMakeLists.txt?

1

There are 1 best solutions below

0
On

Ask him to send you his "path" env. variable, you will find something interesting there for sure.

Other issue is Java installations. Ask him to unstall old javas or just update to newest, current installer removes older copies.