--- CMakeLists.txt.orig	2022-08-20 02:45:49 UTC
+++ CMakeLists.txt
@@ -53,7 +53,7 @@ set(GENDIR ${CMAKE_CURRENT_BINARY_DIR}/generated)
 
 # Python
 if (SURELOG_WITH_PYTHON)
-  find_package(Python3 3.3 REQUIRED COMPONENTS Interpreter Development)
+  find_package(Python3 ${FREEBSD_PYTHON_DISTVERSION} EXACT REQUIRED COMPONENTS Interpreter Development)
   find_package(SWIG 3.0 REQUIRED)
   message(STATUS "Python3_LIBRARIES = ${Python3_LIBRARIES}")
   message(STATUS "Python3_EXECUTABLE = ${Python3_EXECUTABLE}")
@@ -140,7 +140,7 @@ add_custom_command(
           ${FLATBUFFERS_FLATC_EXECUTABLE})
 
 # Java
-find_package(Java 11 REQUIRED COMPONENTS Runtime)
+find_package(Java ${FREEBSD_JAVA_VERSION} REQUIRED COMPONENTS Runtime)
 message(STATUS "Java_JAVA_EXECUTABLE = ${Java_JAVA_EXECUTABLE}")
 set(ANTLR_JAR_LOCATION
     ${PROJECT_SOURCE_DIR}/third_party/antlr4_bin/antlr-4.10-complete.jar)
