Description: libjvm_detection_for_newer_openjdk
 Newer OpenJDK package, like the one from Ubuntu Bionic
 don't have jre and $arch subfolders anymore.
 .
 mesos (1.4.1-2) unstable; urgency=medium
 .
   * Set TasksMax=infinity in mesos-slave systemd otherwise
     child max limit can be reached.
Author: Adam Cecile <acecile@le-vert.net>

---
Origin: other
Bug: TODO
Forwarded: no
Reviewed-By: TODO
Last-Update: 2018-07-10

--- mesos-1.4.1.orig/configure.ac
+++ mesos-1.4.1/configure.ac
@@ -1136,6 +1136,14 @@ __EOF__
 	break;
       fi
     done
+    # Newer OpenJDK (like version 10 in Ubuntu Bionic)
+    # do not include jre and $arch subfolders
+    dir="$JAVA_HOME/lib/server"
+    if test -e "$dir"; then
+      # Note that these are libtool specific flags.
+      JAVA_TEST_LDFLAGS="-L$dir -R$dir -Wl,-ljvm"
+      JAVA_JVM_LIBRARY=$dir/libjvm.so
+    fi
   elif test "$OS_NAME" = "freebsd"; then
     for arch in amd64 i386 arm; do
       dir="$JAVA_HOME/jre/lib/$arch/server"
