It might be a bit early for this as Java 18 is still subject to change. As things stand, we could use the new getAttributes() method on java.security.KeyStore to detect Java 18. Adding EIGHTEEN will allow us to continue to test the range support in @ConditionalOnJava once the constants for Java 16 and earlier have been removed.

Comment From: dreis2211

If I may suggest java.time.Duration::isPositive() for detection...

Comment From: wilkinsona

Is there any particular reason to go for that over getAttributes() on KeyStore, @dreis2211? I don't feel strongly about the method that we use, just curious.

Comment From: dreis2211

Duration is probably loaded/initialized already, KeyStore maybe not. Also it's the more widely known class and thus fits better in the currently used ones in JavaVersion. I don't really care either.

Comment From: wilkinsona

Duration is probably loaded/initialized already, KeyStore maybe not.

That's a good point. Ok, let's go with Duration::isPositive(). Thanks for the suggestion.