Find files compiled at a specific Java version

Apache 2.0

Finds Java source files matching a particular language level. This is useful especially as a precondition for other recipes.

org.openrewrite.java.search.HasJavaVersion

Required

An exact version number or node-style semver selector used to select the version number.

Optional

checkTargetCompatibilityBoolean

The source and target compatibility versions can be different. This option allows you to check against the target compatibility version instead of the source compatibility version.

mod run . --recipe=org.openrewrite.java.search.HasJavaVersion \ -P version=17.X

Install it once from Recipe actions, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.