Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Support `java { toolchain { languageVersion`

Open
#724 8 comments 26 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
java
Domain
build-system

Research direction

Start with plugin-gradle/src/main/java/com/diffplug/gradle/spotless/SpotlessTaskImpl.java at line 50, where Spotless invocation is inlined into task execution. Investigate how Gradle JavaExec and toolchains can run a separate main file. Done means Spotless uses the configured Java toolchain for execution without making the build depend on the JVM running Gradle.

Written by the indexing model from the issue text.

Description

enhancement

Currently, the spotless invocation is inlined into the task execution itself.

https://github.com/diffplug/spotless/blob/main/plugin-gradle/src/main/java/com/diffplug/gradle/spotless/SpotlessTaskImpl.java#L50

Is it possible to instead run a separate main file in JavaExec? Gradle has introduced toolchain feature to allow build to control the Java version used for compile and execution which works very well to allow any user's Java version to run the build with a specific one. But unfortunately, this currently doesn't affect Spotless which runs in Gradle itself - for example, this means that a build must become unbuildable on Java 8 to upgrade to the latest googleJavaFormat since it requires higher Java version. It would be nice if this could be avoided.

Dominant language
Java
Stars
5.7k
Forks
560
Avg merge
1d 13h
Merged PRs (30d)
43

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from diffplug/spotless

All issues in diffplug/spotless

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.