Preview Site
To preview the generated static site locally:
- •
Check if
_site/directory exists and containsindex.html. If not, runjbang run build.javafirst to build the site. - •
Open the browser to
http://localhost:8000:- •Windows:
Start-Process "http://localhost:8000" - •macOS:
open http://localhost:8000 - •Linux:
xdg-open http://localhost:8000
- •Windows:
- •
Start jwebserver in the foreground from the
_sitedirectory:- •Windows:
Set-Location _site; & "$env:JAVA_HOME\bin\jwebserver.exe" - •Unix/Mac:
cd _site && $JAVA_HOME/bin/jwebserver
- •Windows:
- •
Use
mode="async"without detach so the server runs in the foreground and can be stopped with Ctrl+C. - •
Inform the user the preview server is running on http://localhost:8000 and can be stopped with Ctrl+C or the stop button.
Requirements
- •Java 18+ (jwebserver was introduced in Java 18)
- •JAVA_HOME environment variable must be set