Skip to content

Commit

Permalink
Fail if Java version is not 8. (#567)
Browse files Browse the repository at this point in the history
  • Loading branch information
markro49 authored May 24, 2024
1 parent 9256b7b commit 4d1479e
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions framework/core/Constants.pm
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,21 @@ The directory name of the local gradle repository (I<.gradle_local_home>).

our $GRADLE_LOCAL_HOME_DIR = ($ENV{'GRADLE_LOCAL_HOME_DIR'} // ".gradle_local_home");

#
# Check if we have the correct version of Java
#
# Run the 'java -version' command and capture its output
my $java_version_output = `java -version 2>&1`;

# Extract the imajor version number using regular expressions
if ($java_version_output =~ 'version "?(?:1\.)?(\K\d+)') {
if ($1 != 8) {
die ("Java 8 is required!\n\n");
}
} else {
die ("Failed to parse Java version! Is Java installed/on the execution path?\n\n");
}

#
# Check whether Defects4J has been properly initialized:
# - Project repos available?
Expand Down

0 comments on commit 4d1479e

Please sign in to comment.