title: Cmake not finding JNI when JAVA_HOME is set correctly
body: <p>So I am trying to build cmake so I can use it with a Java GUI I am designing. I have ready many questions on here, and looked up several tutorials on how to do this, and the one commonality is they all seem to say, if it does not work, set JAVA_HOME to the JDK location. But I have done that and it still does not work.</p>
  
  <p>The cmake output for java is this:</p>
  
  <pre><code>--   Java:                          
  --     ant:                         /usr/bin/ant (ver 1.10.3)
  --     JNI:                         NO
  --     Java wrappers:               NO
  --     Java tests:                  NO
  </code></pre>
  
  <p>and to show I have JAVA_HOME set:</p>
  
  <pre><code>echo $JAVA_HOME
  /usr/lib/jvm/java-11-openjdk-amd64
  which java
  /usr/bin/java
  
  namei /usr/bin/java
  f: /usr/bin/java
   d /
   d usr
   d bin
   l java -&gt; /etc/alternatives/java
     d /
     d etc
     d alternatives
     l java -&gt; /usr/lib/jvm/java-11-openjdk-amd64/bin/java
       d /
       d usr
       d lib
       d jvm
       d java-11-openjdk-amd64
       d bin
       - java
  
  echo $PATH
  /usr/lib/jvm/java-11-openjdk-amd64/bin:/usr/local/sbin:/usr/local/bin:/usr      /sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
  </code></pre>
  
  <p>So I have my environment variable set, and it finds ant just fine, but refused to find JNI. Anyone have any ideas why?</p>