From 76b80d261cc57dd3ce3b56e1e6de0311c6855073 Mon Sep 17 00:00:00 2001
From: Alexander Scheel <ascheel@redhat.com>
Date: Wed, 24 Apr 2019 13:04:16 -0400
Subject: [PATCH] Use JDK8 as the source and target release

Signed-off-by: Alexander Scheel <ascheel@redhat.com>
---
 cmake/JSSConfig.cmake | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/cmake/JSSConfig.cmake b/cmake/JSSConfig.cmake
index fcbd3742..45fd8648 100644
--- a/cmake/JSSConfig.cmake
+++ b/cmake/JSSConfig.cmake
@@ -249,6 +249,13 @@ macro(jss_config_java)
     list(APPEND JSS_JAVAC_FLAGS "${JAVAC_CLASSPATH}")
     list(APPEND JSS_JAVAC_FLAGS "-sourcepath")
     list(APPEND JSS_JAVAC_FLAGS "${PROJECT_SOURCE_DIR}")
+
+    # Ensure we're compatible with JDK 8
+    list(APPEND JSS_JAVAC_FLAGS "-target")
+    list(APPEND JSS_JAVAC_FLAGS "1.8")
+    list(APPEND JSS_JAVAC_FLAGS "-source")
+    list(APPEND JSS_JAVAC_FLAGS "1.8")
+
     if("${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
         list(APPEND JSS_JAVAC_FLAGS "-g")
     else()
@@ -260,6 +267,13 @@ macro(jss_config_java)
     list(APPEND JSS_TEST_JAVAC_FLAGS "${JAVAC_CLASSPATH}:${JUNIT4_JAR}")
     list(APPEND JSS_TEST_JAVAC_FLAGS "-sourcepath")
     list(APPEND JSS_TEST_JAVAC_FLAGS "${PROJECT_SOURCE_DIR}")
+
+    # Ensure we're compatible with JDK 8
+    list(APPEND JSS_TEST_JAVAC_FLAGS "-target")
+    list(APPEND JSS_TEST_JAVAC_FLAGS "1.8")
+    list(APPEND JSS_TEST_JAVAC_FLAGS "-source")
+    list(APPEND JSS_TEST_JAVAC_FLAGS "1.8")
+
     if("${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
         list(APPEND JSS_TEST_JAVAC_FLAGS "-g")
     else()
