Skip to content

Commit dc0f9b6

Browse files
Add Java 25 devcontainer and SDKMAN setup documentation
Co-authored-by: thomasturrell <1552612+thomasturrell@users.noreply.github.com>
1 parent 0c70f15 commit dc0f9b6

2 files changed

Lines changed: 82 additions & 1 deletion

File tree

.devcontainer/devcontainer.json

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"name": "xapi-java (Java 25)",
3+
"image": "mcr.microsoft.com/devcontainers/base:latest",
4+
"features": {
5+
"ghcr.io/devcontainers/features/java:2": {
6+
"version": "25"
7+
},
8+
"ghcr.io/devcontainers/features/sdkman:1": {}
9+
},
10+
"postCreateCommand": "sdk install java 25.0.1-tem || true",
11+
"customizations": {
12+
"vscode": {
13+
"extensions": [
14+
"vscjava.vscode-java-pack",
15+
"redhat.java"
16+
]
17+
}
18+
}
19+
}

.github/copilot-instructions.md

Lines changed: 63 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ xAPI Java is a library that helps you create applications that send or receive x
1111

1212
## Technology Stack
1313

14-
- **Language**: Java 17 or newer (required)
14+
- **Language**: Java 25 (required)
1515
- **Build Tool**: Maven (using Maven Wrapper `./mvnw`)
1616
- **Framework**: Spring Boot 3.5.7, Spring WebClient (reactive)
1717
- **Code Style**: Google Java Style Guide enforced via CheckStyle
@@ -22,6 +22,32 @@ xAPI Java is a library that helps you create applications that send or receive x
2222

2323
## Building and Testing
2424

25+
### Setting Up Java 25
26+
27+
#### Using SDKMAN (Recommended)
28+
29+
To ensure you have the correct Java version, use SDKMAN to pin a specific JVM identifier. SDKMAN identifiers vary by OS and CPU architecture, so first discover available Java 25 builds:
30+
31+
```bash
32+
# List all Java 25 versions available for your platform
33+
sdk list java | grep 25
34+
35+
# Install a specific Temurin 25 build (example identifier - check your platform)
36+
sdk install java 25.0.1-tem
37+
38+
# Set it as default
39+
sdk default java 25.0.1-tem
40+
41+
# Or use it just for this shell session
42+
sdk use java 25.0.1-tem
43+
```
44+
45+
**Note**: The identifier `25.0.1-tem` is an example for Eclipse Temurin. Run `sdk list java` to find the exact identifier for your platform (OS and architecture). Other distributions like GraalVM, Amazon Corretto, or Zulu may use different identifiers like `25.0.1-graal`, `25.0.1-amzn`, or `25.0.1-zulu`.
46+
47+
#### Using GitHub Codespaces or DevContainers
48+
49+
If you're using GitHub Codespaces or a local devcontainer, Java 25 will be automatically configured. See the [DevContainer Setup](#devcontainer-setup) section below.
50+
2551
### Build Commands
2652

2753
```bash
@@ -46,6 +72,42 @@ Always run the full build before starting work to ensure you understand the curr
4672
./mvnw clean verify
4773
```
4874

75+
## DevContainer Setup
76+
77+
For contributors using GitHub Codespaces or local devcontainers, this project includes a `.devcontainer/devcontainer.json` configuration that automatically sets up Java 25. This ensures a consistent development environment across all contributors.
78+
79+
### Example DevContainer Configuration
80+
81+
The project's devcontainer uses the official DevContainers Java feature to install Java 25 and includes SDKMAN for flexibility:
82+
83+
```json
84+
{
85+
"name": "xapi-java (Java 25)",
86+
"image": "mcr.microsoft.com/devcontainers/base:latest",
87+
"features": {
88+
"ghcr.io/devcontainers/features/java:2": {
89+
"version": "25"
90+
},
91+
"ghcr.io/devcontainers/features/sdkman:1": {}
92+
},
93+
"postCreateCommand": "sdk install java 25.0.1-tem || true",
94+
"customizations": {
95+
"vscode": {
96+
"extensions": [
97+
"vscjava.vscode-java-pack",
98+
"redhat.java"
99+
]
100+
}
101+
}
102+
}
103+
```
104+
105+
The configuration:
106+
- Uses the official DevContainers Java feature to install Java 25
107+
- Includes SDKMAN for manual version management if needed
108+
- Attempts to install a specific Temurin 25 build as a fallback (the `|| true` ensures the container still builds if the specific identifier isn't available)
109+
- Pre-installs useful VS Code Java extensions
110+
49111
## Code Style and Quality
50112

51113
### Style Guide

0 commit comments

Comments
 (0)