Spoon
Spoon is a free, open-source library for working with Java source code through an abstract syntax tree (AST).
What Spoon is
Spoon is a free, open-source library for working with Java source code through an abstract syntax tree (AST). It lets developers inspect, analyze, rewrite, transform, and transpile code. Its processors support source-level static analysis, while transformation tools can be used for instrumentation and refactoring. The documentation also describes expressing architectural rules as AST checks and running them as JUnit tests in continuous integration. Spoon can analyze source and binary code together through CtClass objects, offering an alternative to Java reflection. It supports modern Java versions up to Java 25, but the JDK needed to run it depends on the Spoon release: 11.x requires JDK 17 or later, 10.x requires JDK 11 or later, and 9.x requires Java 8. Spoon can be used from Java, the command line, Maven, or Gradle. Command-line users manage the classpath themselves and should provide analyzed-source dependencies with --source-classpath. It is available under the CeCILL-C and MIT licenses.
Good
- Supports Java source analysis through AST processors
- Transforms code for instrumentation and refactoring
- Works with Maven, Gradle, Java, and command line
- Free and open source under two licenses
Watch out
- Running requirements vary by Spoon release
- Command-line users must manage the classpath manually
- Semantic patching is a prototype subset
Who it suits
Spoon suits Java developers who need AST-based analysis, code transformation, or repository refactoring. It also fits teams that want to express architectural checks as JUnit tests in continuous integration.
Verdict
Spoon brings source analysis and transformation into a shared AST-based workflow for Java projects. Check the release-specific JDK requirement and command-line classpath needs before choosing an installation approach.
Plans and prices
From Spoon's own pricing page, checked 5 Oct 2026.
| Plan | Price | What it gives you |
|---|---|---|
| Free and Open Source | Free | No paid plans or usage limits stated |
The facts
Each one read from Spoon's own pages, with the date it was checked.
What it does
- Analysis
- Spoon supports source-level static code analysis using processors that inspect AST elements of a selected type.checked 5 Oct 2026
- Architecture checks
- The documentation describes expressing architectural rules as AST analysis and running them as JUnit tests in continuous integration.checked 5 Oct 2026
- AST model
- It parses Java source files into an abstract syntax tree with analysis and transformation APIs.checked 5 Oct 2026
- Code transformation
- Spoon can transform source code, including for instrumentation and refactoring.checked 5 Oct 2026
- Command-line limitation
- When using Spoon from the command line, users handle the classpath manually and should specify dependencies of analyzed source files with --source-classpath.checked 5 Oct 2026
- Community
- The project welcomes external contributions through pull requests.checked 5 Oct 2026
- Compatibility limit
- Although it can consume source code for older Java versions, Spoon needs the specified JDK version to run.checked 5 Oct 2026
- Install options
- The documentation describes using Spoon from Java, the command line, Maven, or Gradle, and downloading its dependency jar from Maven Central for command-line use.checked 5 Oct 2026
- Integrations
- The site documents Maven and Gradle usage, along with command-line execution using a JAR from Maven Central.checked 5 Oct 2026
- Java runtime requirements
- Spoon 11.x requires JDK 17 or later, Spoon 10.x requires JDK 11 or later, and Spoon 9.x requires Java 8.checked 5 Oct 2026
- Java support
- The site says Spoon supports modern Java versions up to Java 25.checked 5 Oct 2026
- License
- Spoon is free and open source under the CeCILL-C and MIT licenses.checked 5 Oct 2026
- Parallel processing
- Spoon provides an AbstractParallelProcessor API for running processors in parallel, with the documentation advising against using more parallel processors than available cores.checked 5 Oct 2026
- Project affiliation
- The site identifies Spoon as an official Inria open-source project and a member of the OW2 open-source consortium.checked 5 Oct 2026
- Purpose
- Spoon is an open-source library for analyzing, rewriting, transforming, and transpiling Java source code.checked 5 Oct 2026
- Refactoring
- The documentation describes local-variable and generic-variable refactoring helpers, as well as a helper for removing deprecated methods.checked 5 Oct 2026
- Reflection
- Spoon can act as an alternative to Java reflection and allows shared analysis of binary and source code through CtClass objects.checked 5 Oct 2026
- Runtime requirement
- Spoon 11.x requires JDK 17 or later, 10.x requires JDK 11 or later, and 9.x requires Java 8 to run.checked 5 Oct 2026
- Semantic patching
- The spoon-smpl submodule is described as a prototype implementation of a subset of Semantic Patch Language for a subset of Java.checked 5 Oct 2026
- Static analysis
- Spoon supports source-level static analysis through processors that inspect AST elements.checked 5 Oct 2026
- Support
- The site directs users seeking professional development, training, or extension support to comment on a GitHub issue.checked 5 Oct 2026
- What it does
- Spoon is an open-source library for analyzing, rewriting, transforming, and transpiling Java source code through an abstract syntax tree (AST).checked 5 Oct 2026
Alternatives to Spoon
- 1

Sourcery
Free planWebAPIExtensionLinux7.9From $12 a month - 2

Moderne
WebAPILinuxmacOS7.3From $2,000 a month - 3

ast-grep
Free planWebAPIExtensionLinux7.0Free plan - 4

ReSharper
Free planExtensionLinuxmacOSWindows6.8From $389 a year - 5
jSparrow
LinuxmacOSWindows6.4From $1,325 a year - 6

CodeRush
Free planExtensionLinuxmacOSWindows6.3Free plan
