Skip to content

Commit d907511

Browse files
authored
Update JavaVersionChecker to enforce min of JDK21 (#18034)
Signed-off-by: Andrew Ross <[email protected]>
1 parent e945960 commit d907511

File tree

1 file changed

+4
-4
lines changed
  • distribution/tools/java-version-checker/src/main/java/org/opensearch/tools/java_version_checker

1 file changed

+4
-4
lines changed

distribution/tools/java-version-checker/src/main/java/org/opensearch/tools/java_version_checker/JavaVersionChecker.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,14 @@
3737
import java.util.Locale;
3838

3939
/**
40-
* Simple program that checks if the runtime Java version is at least 11
40+
* Simple program that checks if the runtime Java version is at least 21
4141
*/
4242
final class JavaVersionChecker {
4343

4444
private JavaVersionChecker() {}
4545

4646
/**
47-
* The main entry point. The exit code is 0 if the Java version is at least 11, otherwise the exit code is 1.
47+
* The main entry point. The exit code is 0 if the Java version is at least 21, otherwise the exit code is 1.
4848
*
4949
* @param args the args to the program which are rejected if not empty
5050
*/
@@ -53,10 +53,10 @@ public static void main(final String[] args) {
5353
if (args.length != 0) {
5454
throw new IllegalArgumentException("expected zero arguments but was " + Arrays.toString(args));
5555
}
56-
if (Runtime.version().compareTo(Version.parse("11")) < 0) {
56+
if (Runtime.version().compareTo(Version.parse("21")) < 0) {
5757
final String message = String.format(
5858
Locale.ROOT,
59-
"OpenSearch requires Java 11; your Java version from [%s] does not meet this requirement",
59+
"OpenSearch requires Java 21; your Java version from [%s] does not meet this requirement",
6060
System.getProperty("java.home")
6161
);
6262
errPrintln(message);

0 commit comments

Comments
 (0)