To set a specific Java version for Maven, you can specify the maven.compiler.source and maven.compiler.target properties in the pom.xml file.