Want to try out Java for web development?
This repo builds a Weather API and a web frontend in a single Java project using the JDK 25 built-in HTTP server (jdk.httpserver).
You get both backend and frontend in one place, and where you go from here is up to you.
Everything you do here is contained within this one codespace. There is no repository on GitHub yet. If and when you’re ready you can click "Publish Branch" and we’ll create your repository and push up your project. If you were just exploring then and have no further need for this code then you can simply delete your codespace and it’s gone forever.
You can also run this repository locally by following these instructions:
- Clone the repo to your local machine
git clone https://github.com/github/java-codespaces - Open repo in VS Code
- 📤 One-click setup: Open a new Codespace, giving you a fully configured cloud developer environment.
▶️ Build and run:- Compile:
mvn compile -f sample-app/pom.xml - Start:
java --module-path sample-app/target/classes --module com.example.app/com.example.app.Application
- Compile:
- Open the forwarded port 8080 in your browser.
- Web app:
/ - API endpoint:
/api/w
- Web app: