Freedom251 › Code Refactoring Tools
Spoon

What Spoon is
Spoon is a free, open-source library for analyzing and changing Java source code. It parses source files into an abstract syntax tree (AST), then provides APIs for inspection, transformation, rewriting, and transpilation. Its processors can examine selected AST element types for source-level static analysis. Developers can also express architectural rules as AST checks and run them as JUnit tests in continuous integration. Transformation uses include instrumentation and refactoring, with helpers for variables and removing deprecated methods. Spoon can also support shared analysis of source and binary code through CtClass objects, as an alternative to Java reflection. The project supports Java through Java 25, but its runtime needs vary by release: Spoon 11.x requires JDK 17 or later, 10.x requires JDK 11 or later, and 9.x requires Java 8. It can be used from Java, Maven, Gradle, or the command line. Command-line use requires manual classpath handling, including analyzed-source dependencies. Spoon is available under the CeCILL-C and MIT licenses.
Who it suits
Spoon suits Java developers who need to inspect or transform source code, build static-analysis processors, or check architectural rules. It is also relevant to teams applying refactoring or instrumentation across a repository.
What it does well
- Supports source-level static analysis with AST processors
- Can express architectural rules as JUnit tests
- Includes refactoring and instrumentation capabilities
- Works with Java, Maven, Gradle, and the command line
What to know first
- Runtime JDK requirements vary by Spoon release
- Command-line users must manage the classpath manually
Limits
The free plan is listed as free, with no paid plans or usage limits stated. Runtime requirements depend on the release: Spoon 11.x needs JDK 17 or later, 10.x needs JDK 11 or later, and 9.x needs Java 8; support for older source code does not remove the JDK requirement.
Plans
| Plan | Billed and limits | Price |
|---|---|---|
| Free and Open Source | No paid plans or usage limits stated | Free |
As spoon.gforge.inria.fr lists them, read 5 Oct 2026. The maker's own page has the final word.
Getting started
- Visit the Spoon website.
- Choose a usage route: Java, Maven, Gradle, or command line.
- Select a Spoon release compatible with the JDK available to you.
- For command-line use, obtain the dependency JAR from Maven Central.
- When analyzing source files from the command line, manage the classpath and specify dependencies with --source-classpath.
Verdict
Spoon brings Java parsing, analysis, and transformation into one library, with documented support for workflows from refactoring to CI architecture checks. Check the JDK requirement for the release you plan to run, and account for manual classpath setup if using the command line.
Questions
Is Spoon free?
Yes. Its Free and Open Source plan is listed as free, and the project uses the CeCILL-C and MIT licenses.
Which Java versions does Spoon support?
The site says it supports modern Java versions up to Java 25. The JDK needed to run Spoon depends on the release: 11.x requires JDK 17 or later, 10.x requires JDK 11 or later, and 9.x requires Java 8.
How can I use or install Spoon?
The documentation covers Java, Maven, Gradle, and command-line use. For command-line use, it describes downloading the dependency JAR from Maven Central.
What can Spoon analyze or change?
It parses Java source into an AST for inspection, static analysis, rewriting, transformation, and transpilation. It also supports refactoring and shared source and binary analysis through CtClass objects.
Does Spoon support command-line analysis?
Yes. Command-line users handle the classpath manually and should specify analyzed-source dependencies with --source-classpath.
Who maintains Spoon?
The site identifies Spoon as an official Inria open-source project and a member of the OW2 open-source consortium.
Facts from Spoon's own pages
- Analysis
- Spoon supports source-level static code analysis using processors that inspect AST elements of a selected type. · spoon.gforge.inria.fr, 5 Oct 2026
- Architecture checks
- The documentation describes expressing architectural rules as AST analysis and running them as JUnit tests in continuous integration. · spoon.gforge.inria.fr, 5 Oct 2026
- AST model
- It parses Java source files into an abstract syntax tree with analysis and transformation APIs. · spoon.gforge.inria.fr, 5 Oct 2026
- Code transformation
- Spoon can transform source code, including for instrumentation and refactoring. · spoon.gforge.inria.fr, 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. · spoon.gforge.inria.fr, 5 Oct 2026
- Community
- The project welcomes external contributions through pull requests. · spoon.gforge.inria.fr, 5 Oct 2026
- Compatibility limit
- Although it can consume source code for older Java versions, Spoon needs the specified JDK version to run. · spoon.gforge.inria.fr, 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. · spoon.gforge.inria.fr, 5 Oct 2026
- Integrations
- The site documents Maven and Gradle usage, along with command-line execution using a JAR from Maven Central. · spoon.gforge.inria.fr, 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. · spoon.gforge.inria.fr, 5 Oct 2026
- Java support
- The site says Spoon supports modern Java versions up to Java 25. · spoon.gforge.inria.fr, 5 Oct 2026
- License
- Spoon is free and open source under the CeCILL-C and MIT licenses. · spoon.gforge.inria.fr, 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. · spoon.gforge.inria.fr, 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. · spoon.gforge.inria.fr, 5 Oct 2026
- Purpose
- Spoon is an open-source library for analyzing, rewriting, transforming, and transpiling Java source code. · spoon.gforge.inria.fr, 5 Oct 2026
- Refactoring
- The documentation describes local-variable and generic-variable refactoring helpers, as well as a helper for removing deprecated methods. · spoon.gforge.inria.fr, 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. · spoon.gforge.inria.fr, 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. · spoon.gforge.inria.fr, 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. · spoon.gforge.inria.fr, 5 Oct 2026
- Static analysis
- Spoon supports source-level static analysis through processors that inspect AST elements. · spoon.gforge.inria.fr, 5 Oct 2026
- Support
- The site directs users seeking professional development, training, or extension support to comment on a GitHub issue. · spoon.gforge.inria.fr, 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). · spoon.gforge.inria.fr, 5 Oct 2026
Where Spoon stands on Freedom251
- Code Refactoring Tools#15 of 22