tryjshell.org is a web terminal to try and test Java 27 and its preview features on the JShell tool.
Open: https://tryjshell.org
docker run -it --rm -p 8080:8080 rahmanusta/tryjshell
run.sh starts it with the same sandbox flags that are used in production.
All settings are environment variables.
| Variable | Default | Description |
|---|---|---|
|
12 |
Concurrent jshell sessions on the server |
|
3 |
Concurrent sessions per client IP ( |
|
60 |
Hard limit for a single session |
|
1 |
jshell processes kept warm for fast startup |
|
(any) |
Comma separated list of allowed WebSocket origins |
|
|
Options passed to |
JShell executes arbitrary Java code, so a visitor can run any program inside the container. The goal is to keep that contained:
-
No network. In production the container is only attached to an internal Docker network whose bridge has no address on the host. Code cannot reach the internet, the cloud metadata service, the host or other containers. Only nginx-proxy joins that network. See
deploy/tryjshell_restart.sh. -
Immutable image. Read-only root filesystem; the JDK and the server jar are owned by root.
/tmpis a smallnoexectmpfs, so dropped binaries cannot be executed. -
Least privilege. Non-root user, all Linux capabilities dropped,
no-new-privileges. -
Resource limits. CPU, memory, process count and file descriptors are capped, as are sessions per IP and in total.
-
Session isolation and cleanup. Every session gets its own home, working directory and JShell preferences (history is not shared). When a session ends, its whole process tree and directory are removed; processes that try to escape with
setsid/nohupare reaped within a minute.
Visitors still share one container and one Unix user, so a malicious visitor can observe or disturb other sessions running at the same time. Nothing else runs in the container.
