A command-line tool that analyzes Java class field names and types recursively. Given a Java source file or compiled class file, it generates a JSON report containing all fields from the specified class down to classes that only contain primitive types or standard Java library types.
- Analyzes Java source files (
.java) or compiled class files (.class) - Recursively scans all field types and their dependencies
- Generates JSON output with both tree and flat representations
- Supports multithreaded analysis for better performance
- Automatically detects Maven projects and resolves dependencies
class-scanner <file> [OPTIONS]# Analyze a Java source file
class-scanner MyClass.java
# Analyze with verbose output
class-scanner MyClass.java -v
# Save output to file
class-scanner MyClass.java -f analysis.json
# Use custom number of threads
class-scanner MyClass.java -t 8
# Full example with all options
class-scanner /path/to/MyClass.java -v -t 4 -f output.json| Option | Description |
|---|---|
-v, --verbose |
Enable verbose output with progress information |
-f, --file FILE |
Save output to file instead of stdout |
-t, --threads INT |
Number of threads to use (default: number of CPU cores) |
-h, --help |
Show help message |
- Java 11 or later
- Maven (for analyzing Java source files)
-
Download or build the JAR file
gradlew shadowJar
-
Run the installation script as Administrator
install-cli.bat
-
Restart your command prompt
-
Test the installation
class-scanner --help
If the automatic installer doesn't work:
- Create
C:\bindirectory - Copy
class-scanner-1.0-SNAPSHOT-all.jartoC:\bin\class-scanner.jar - Create
C:\bin\class-scanner.batwith:@echo off java -jar "C:\bin\class-scanner.jar" %*
- Add
C:\binto your PATH environment variable
- For .java files: Maven must be installed and available in PATH
- For .class files: Only Java runtime required