rewrite-java-11 and rewrite-java-8 can happily coexist on the same classpath. At runtime the appropriate module for the current JDK will be selected.
Set Language Level and Bytecode Level
In order to be able to use OpenRewrite to modernize old projects it's important to be able to run on older JDK implementations. So configure the Java compiler to target Java Language and Bytecode level 1.8.
// See https://docs.gradle.org/current/userguide/building_java_projects.html#sec:java_cross_compilation
<!-- Replacing default-compile as it is treated specially by maven -->
<!-- Replacing default-testCompile as it is treated specially by maven -->
Throughout OpenRewrite's documentation Java is used for Recipe authoring and Kotlin is used for test authoring. You do not have to be constrained by this recommendation: Recipes and tests can be authored in any language that runs on the JVM.
Having configured the project per these recommendations, you're now able to begin Recipe development. With Gradle and Maven's default project layout, here is where to put the various kinds of sources that go into a OpenRewrite Module:
src/main/java - Recipe implementations in Java
src/main/kotlin - Recipe implementations in Kotlin
Project setup is complete. You are ready to move on to authoring a Recipe!
With your project set up as instructed by this guide the jar produced by your build is ready to be consumed as a rewrite module. Once published to an artifact repository like Maven Central, other projects can take a dependency on your OpenRewrite module and activate the recipes contained therein.