diff --git a/README.md b/README.md index 898f9f551fa3..4b7bd1fb8c96 100644 --- a/README.md +++ b/README.md @@ -44,7 +44,7 @@ The mission of OpenMRS is to improve health care delivery in resource-constraine OpenMRS is a Java application which is why you need to install a Java JDK. -If you want to build the master branch you will need a Java JDK of minimum version 8. +If you want to build the master branch you will need a Java JDK of minimum version 21. #### Maven diff --git a/api/src/main/java/org/openmrs/util/OpenmrsUtil.java b/api/src/main/java/org/openmrs/util/OpenmrsUtil.java index a942de53285f..81bab27c986b 100644 --- a/api/src/main/java/org/openmrs/util/OpenmrsUtil.java +++ b/api/src/main/java/org/openmrs/util/OpenmrsUtil.java @@ -1070,15 +1070,14 @@ public static String getOpenmrsLogLocation() { } /** - * Checks whether the current JVM version is at least Java 8. + * Checks whether the current JVM version is at least Java 21. * - * @throws APIException if the current JVM version is earlier than Java 8 + * @throws APIException if the current JVM version is earlier than Java 21 */ public static void validateJavaVersion() { - // check whether the current JVM version is at least Java 8 - if (System.getProperty("java.version").matches("1\\.[0-7]\\.(.*)")) { + if (System.getProperty("java.version").matches("(1\\..*)|(9|1[0-9]|20)(\\..*)?" )) { throw new APIException( - "OpenMRS " + OpenmrsConstants.OPENMRS_VERSION_SHORT + " requires Java 8 and above, but is running under " + + "OpenMRS " + OpenmrsConstants.OPENMRS_VERSION_SHORT + " requires Java 21 and above, but is running under " + System.getProperty("java.version")); } } diff --git a/pom.xml b/pom.xml index 804c3d3d97f3..25e1d77826c2 100644 --- a/pom.xml +++ b/pom.xml @@ -495,6 +495,16 @@ mockito-junit-jupiter ${mockitoVersion} + + net.bytebuddy + byte-buddy + 1.17.7 + + + net.bytebuddy + byte-buddy-agent + 1.17.7 + - - java17 - - 17 - - - - - org.mockito - mockito-core - 5.19.0 - - - net.bytebuddy - byte-buddy - 1.17.7 - - - net.bytebuddy - byte-buddy-agent - 1.17.7 - - - - - - - java21 - - 21 - - - - - org.mockito - mockito-core - 5.19.0 - - - net.bytebuddy - byte-buddy - 1.17.7 - - - net.bytebuddy - byte-buddy-agent - 1.17.7 - - - - - - - java24 - - 24 - - - - - org.mockito - mockito-core - 5.19.0 - - - net.bytebuddy - byte-buddy - 1.17.7 - - - net.bytebuddy - byte-buddy-agent - 1.17.7 - - - - diff --git a/startup.sh b/startup.sh index 47b2b3e47587..eb70fe68cc2b 100644 --- a/startup.sh +++ b/startup.sh @@ -65,13 +65,7 @@ CATALINA_OPTS="${OMRS_JAVA_MEMORY_OPTS} -DOPENMRS_INSTALLATION_SCRIPT=${OMRS_SER if [ -n "${OMRS_DEV_DEBUG_PORT-}" ]; then echo "Enabling debugging on port ${OMRS_DEV_DEBUG_PORT}" - JAVA_VERSION=$(java -version 2>&1 | awk -F '"' '/version/ {print $2}' | awk -F '.' '/.*/ {print $1}') - - if [[ "$JAVA_VERSION" -gt "8" ]]; then - CATALINA_OPTS="$CATALINA_OPTS -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:${OMRS_DEV_DEBUG_PORT}" - else - CATALINA_OPTS="$CATALINA_OPTS -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=${OMRS_DEV_DEBUG_PORT}" - fi + CATALINA_OPTS="$CATALINA_OPTS -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:${OMRS_DEV_DEBUG_PORT}" fi cat > $TOMCAT_SETENV_FILE << EOF diff --git a/test-module/pom.xml b/test-module/pom.xml index 8d5c55bddab1..6488b6f8fa76 100644 --- a/test-module/pom.xml +++ b/test-module/pom.xml @@ -42,7 +42,7 @@ ${project.version} UTF-8 - 1.8 + 21