Quickstart
This guide gets you from a clone to a working analysis.json in a couple of minutes. For installation alternatives (native binary, pre-built JAR via the Python SDK), see Installation.
Prerequisites
Section titled “Prerequisites”- A Linux, macOS, or WSL machine
- A JDK, version 11 or above (Java 17 recommended). We suggest installing it with SDKMan!
Build the JAR
Section titled “Build the JAR”-
Install a JDK (Java 17 shown here, via SDKMan!):
Terminal window sdk install java 17.0.10-semsdk use java 17.0.10-sem -
Clone and build the fat JAR:
Terminal window git clone https://github.com/codellm-devkit/codeanalyzer-javacd codeanalyzer-java./gradlew fatJarThe build produces a self-contained JAR at
build/libs/codeanalyzer-2.3.7.jar. -
Confirm it runs:
Terminal window java -jar build/libs/codeanalyzer-2.3.7.jar --version
Run your first analysis
Section titled “Run your first analysis”Symbol table only (fast)
Section titled “Symbol table only (fast)”Analysis level 1 parses source and builds the symbol table. It does not require building the target project, so it’s quick:
java -jar build/libs/codeanalyzer-2.3.7.jar \ -i /path/to/your/project \ -a 1 \ -o ./outputThis writes ./output/analysis.json containing the symbol_table for every .java file.
Symbol table + call graph
Section titled “Symbol table + call graph”Analysis level 2 additionally builds the WALA call graph. By default codeanalyzer will build the target project (so WALA has compiled classes and resolved dependencies to work from):
java -jar build/libs/codeanalyzer-2.3.7.jar \ -i /path/to/your/project \ -a 2 \ -o ./output \ -vThe -v flag streams progress logs so you can watch the build and call-graph construction.
Analyze a single source string
Section titled “Analyze a single source string”No project, no build — pass Java source directly and get a symbol table back on stdout:
java -jar build/libs/codeanalyzer-2.3.7.jar \ -s "public class Hello { public static void main(String[] a){} }" \ -a 1Read the output
Section titled “Read the output”analysis.json has this top-level shape:
{ "symbol_table": { "/abs/path/File.java": { /* compilation unit */ } }, "call_graph": [ /* caller→callee edges, present at level 2 */ ], "version": "2.3.7"}Continue to the Output schema for the full structure, or the CLI reference for every flag.