- Build:
cargo build(workspace),cargo build -p <crate>(single crate) - Test all:
cargo test - Single test:
cargo test <test_name>orcargo test -p <crate> <test_name> - Format:
cargo fmt, Lint:cargo clippy
- Edition: Rust 2024,
#![no_std]for core crates (usealloccrate) - Line width: 150 chars (rustfmt.toml)
- Indent: 4 spaces, LF line endings
- Imports: Group
alloc/corefirst, then external crates, thencrate::local imports - Naming: snake_case for functions/files, PascalCase for types/traits
- Error handling: Use
Result<T>(alias forresult::Result<T, JavaError>), never panic in library code - Async: Use
#[async_trait::async_trait]for async trait methods,#[tokio::test]for async tests
jvm/- Core JVM implementation (#![no_std])jvm_rust/- Rust-based JVM interpreterjava_runtime/- Java standard library implementationsclassfile/- Class file parserjava_class_proto/- Java class prototypestest_utils/- Shared test utilities
- Keep
java_runtime/tests/classeslimited to Java standard library class and API behavior. - Test JVM and interpreter semantics, including class initialization, bytecode execution, and monitor behavior, with compiled Java fixtures under
test_data/srcand expected output undertest_data, executed bytests/test_class.rs. - Do not place JVM core behavior tests in the
java_runtimestandard library test tree.
- Implement Java compatibility from public specifications, Javadocs, and observable behavior tests. Do not consult or reproduce OpenJDK or other Java runtime implementation source code; keep the implementation independent to avoid licensing and provenance concerns.