# Run the course locally

The Java lab needs JDK 17 or later and Maven 3.9 or later. Its first run downloads test dependencies from Maven Central. Open `exercises/architecture-lab/pom.xml` in your Java IDE or run Maven from that directory.

```sh
java -version
mvn -version
cd "/home/dmedeiros/Documents/ChatGPT/Teach me ArchUnit/exercises/architecture-lab"
mvn test
```

Confirm that `OrientationTest` ran and passed. A successful build with no architecture tests is not the expected result. The lab configures Maven to fail if it discovers no tests.

## Toolchain used in this session

Java and Maven were absent from this machine's shell PATH. A temporary Temurin JDK 21 and Maven 3.9.9 were downloaded under `/tmp/archunit-course-tools` to verify the lab without changing system installations.

While those directories exist, this shell setup lets you follow the lesson commands:

```sh
export JAVA_HOME='/tmp/archunit-course-tools/jdk-21.0.13.1+2'
export PATH="/tmp/archunit-course-tools/apache-maven-3.9.9/bin:$JAVA_HOME/bin:$PATH"
export MAVEN_OPTS='-Dmaven.repo.local=/tmp/archunit-course-tools/m2'
cd "/home/dmedeiros/Documents/ChatGPT/Teach me ArchUnit/exercises/architecture-lab"
mvn test
```

These are temporary verification tools and may disappear after cleanup or reboot. For continued use, configure your usual JDK and Maven installation. Dependencies can be cached in your normal Maven repository by omitting the `MAVEN_OPTS` line. Official setup references: [Temurin](https://adoptium.net/installation/) and [Maven](https://maven.apache.org/install.html).

## Applying the examples to Spring Boot

The lab uses ordinary Jupiter `@Test` methods and calls `rule.check(classes)`. You can use that style in a Boot project without `@SpringBootTest`. For an existing application, retain its dependency management and choose the ArchUnit integration matching its JUnit generation. ArchUnit 1.5.1 provides separate JUnit 5 and JUnit 6 integrations; do not copy the standalone lab's JUnit version over your application's managed version. [ArchUnit installation](https://www.archunit.org/userguide/html/000_Index.html#_installation).

## Rust tool

The Rust lesson explains its own Cargo prerequisites. This machine has Cargo/Rust 1.98.0, but cargo-deny was not installed globally. A temporary official cargo-deny 0.22.1 release binary was downloaded and its SHA-256 verified for the lesson checks.

While it exists, use it without a global installation:

```sh
export PATH="/tmp/archunit-course-tools/cargo-deny-0.22.1-x86_64-unknown-linux-musl:$PATH"
cargo deny --version
```

The lesson also gives the normal pinned installation command. cargo-modules and cargo-semver-checks remain optional installations for their later lessons.
