https://github.com/exercism/java-analyzer
https://github.com/exercism/java-analyzer
community-contributions-accepted exercism-analyzer exercism-tooling maintained
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/exercism/java-analyzer
- Owner: exercism
- License: agpl-3.0
- Created: 2019-03-29T15:25:48.000Z (about 6 years ago)
- Default Branch: main
- Last Pushed: 2025-04-29T00:36:29.000Z (about 1 month ago)
- Last Synced: 2025-04-29T01:37:20.184Z (about 1 month ago)
- Topics: community-contributions-accepted, exercism-analyzer, exercism-tooling, maintained
- Language: Java
- Size: 848 KB
- Stars: 10
- Watchers: 10
- Forks: 19
- Open Issues: 29
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
# Java Analyzer [](https://coveralls.io/github/exercism/java-analyzer?branch=main)
The Java analyzer uses [Abstract Syntax Trees][ast-wiki] (ASTs) to analyze submitted solutions using the [`javaparser`][javaparser] library.
The documentation for this project can be found at [exercism.github.io/java-analyzer/][documentation].
## Contributing
If you want to contribute to the Java analyzer, please refer to the [Contributing Guide][contributing-guide].
## Usage
### Running directly
Start by building the JAR using Gradle:
```sh
./gradlew build
```Then, run the Java analyzer using `build/libs/java-analyzer.jar`.
For example, to analyze a solution for the `leap` exercise, run:```sh
java -jar build/libs/java-analyzer.jar leap /path/to/leap /path/to/output/folder
```The analyzer output is written to `analysis.json` and `tags.json` in `/path/to/output/folder`.
### Running with Docker
To run the Java analyzer using Docker, first build and tag the Docker image:
```sh
docker build -t exercism/java-analyzer .
```Then, run the image and mount the directory of the solution to analyze.
For example, to analyze a solution for the `leap` exercise located at `~/exercism/java/leap`, run:```sh
docker run -v /path/to/leap:/input -v /path/to/output/folder:/output exercism/java-analyzer leap /input /output
```The analyzer output is written to `analysis.json` and `tags.json` in `/path/to/output/folder`.
## Tests
### Unit tests
To run the unit tests:
```sh
./gradlew test
```### Smoke tests
To run the smoke tests using Docker:
```sh
bin/run-tests-in-docker.sh
```[ast-wiki]: https://en.wikipedia.org/wiki/Abstract_syntax_tree
[contributing-guide]: https://github.com/exercism/java-analyzer/blob/main/CONTRIBUTING.md
[documentation]: https://exercism.github.io/java-analyzer/
[javaparser]: https://github.com/javaparser/javaparser