Skip to content

Commit

Permalink
Espresso: Use Runtime.Version to find host version
Browse files Browse the repository at this point in the history
  • Loading branch information
gilles-duboscq authored and marwan-hallaoui committed Apr 15, 2024
1 parent 8bc2ee9 commit 81cf5d6
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ public boolean contains(JavaVersion version) {
}
}

public static final JavaVersion HOST_VERSION = forVersion(System.getProperty("java.version"));
public static final JavaVersion HOST_VERSION = forVersion(Runtime.version());

public static final int LATEST_SUPPORTED = 21;

private final int version;
Expand Down Expand Up @@ -95,6 +96,10 @@ public static JavaVersion forVersion(String version) {
}
}

private static JavaVersion forVersion(Runtime.Version version) {
return forVersion(version.feature());
}

public static JavaVersion latestSupported() {
return forVersion(LATEST_SUPPORTED);
}
Expand Down

0 comments on commit 81cf5d6

Please sign in to comment.