Java-based control plane for terminal workflows, managed runtime tools, secure access, and service operations inside restricted container-hosting environments.
Mini Java Terminal (MJT) is a Java application for running and managing terminal-oriented services where the host environment is restricted, minimal, or panel-managed. It keeps MJT-owned files inside its workspace, exposes a controlled command model, and provides optional integrations for tunnels, SSH/SFTP, website preview, Minecraft targets, and PRoot-based guest environments.
Development snapshot: this branch is under active development. Commands, storage layout, and installer internals may change before a stable release.
- Overview
- Why This Project Exists
- Core Features
- Architecture
- Directory Layout
- Requirements
- Build
- Quick Start
- Command Model
- Managed System Tools
- Networking and Remote Access
- Security Notes
- Third-Party Notices
- License
- Contributing
- Changelog
MJT is designed for hosts where you may have a Java runtime and a writable project directory, but do not necessarily have root access, a full Linux package manager, Docker, or unrestricted process control.
It provides a focused control plane for:
- controlled shell-command execution;
- Cloudflare Tunnel lifecycle and quick-tunnel workflows;
- SSH/SFTP access managed by MJT;
- gateway and website-preview services;
- Minecraft target process management;
- managed runtime prerequisites such as TAR, portable Python, PRoot, and
proot-distro; - isolated PRoot guest-environment workflows.
MJT is not a replacement for a full VM, Docker daemon, or host package manager. It is intended to make limited hosting environments more usable while keeping installation and runtime state under the project workspace.
Restricted game-panel, Java-container, and lightweight hosting environments often provide only part of a normal Linux server experience:
- no root shell;
- no
apt,apk, ordnfaccess; - no direct file manager or SFTP;
- no permanent public port;
- no Docker daemon;
- limited startup-command control.
MJT provides a structured way to operate services within those constraints without requiring the application to own the entire host.
- Command namespaces that distinguish MJT commands from shell commands.
- Controlled shell execution through
.command <shell-command>. - Built-in help index through
.mjt helpor.help. - MJT-owned runtime files and persistent settings.
- Cloudflared discovery and managed installation.
- Cloudflare Tunnel integration.
- Website-preview and gateway workflows.
- Optional public routing through supported tunnel modes.
- Embedded SSH server lifecycle management.
- SSH/SFTP access for MJT-managed workspace use cases.
- Configurable host, port, user, and authentication settings.
- TAR discovery and managed bootstrap.
- Portable Python installation for supported Linux targets.
- Native PRoot installation.
- Upstream
proot-distroinstallation and execution through an MJT-managed launcher. - Linux host detection using kernel data, CPU architecture, bitness, libc, and
/etc/os-release.
- PRoot-based Linux environment workflows.
- Isolated XDG data and cache locations under MJT-controlled storage.
- Catalog, install, activation, and lifecycle operations for supported guest environments.
User / Panel Console
│
▼
Mini Java Terminal
│
├── Command Dispatcher
├── Shell / Service Controllers
├── SSH / SFTP Server
├── Cloudflared / Tunnel Services
├── Gateway / Website Services
├── Minecraft Process Services
└── Managed Runtime Services
├── TAR
├── Portable Python
├── PRoot
└── proot-distro
MJT controls its own files, commands, state, and child processes. It does not attempt to replace the host operating system or bypass hosting-provider restrictions.
The exact directory structure may evolve during development. A typical MJT runtime layout is:
MJT/
├── system/
│ ├── bin/ # MJT-managed launchers and native helpers
│ ├── downloads/ # Verified temporary downloads
│ ├── python/
│ │ └── current/ # Portable Python runtime
│ └── proot-distro/ # Upstream runtime data, cache, and site packages
├── workspace/ # MJT-managed user/project workspace
├── logs/ # Application and installer logs
└── state/ # Persistent configuration/state
Do not manually delete managed runtime directories while their corresponding services are running.
- Java 17 or newer
- Maven 3.9 or newer
- Git
- Linux host environment
- Writable MJT project directory
- Outbound HTTPS access for managed downloads
- A supported CPU architecture for portable runtime components
Current managed Python/PRoot targets are intended for native:
x86_64/amd64aarch64/arm64
MJT inspects:
uname -sruname -mgetconf LONG_BIT- libc indicators
/etc/os-release
This allows installers to select the appropriate upstream runtime asset for the host.
git clone https://github.com/mjt-project/Mini-Java-Terminal.git
cd Mini-Java-Terminal
git checkout dev
mvn -U clean packageThe built server artifact is generated under:
target/server.jar
Run it with the startup command appropriate for the host panel or local environment:
java -jar target/server.jarAfter MJT starts:
.mjt help
Install managed prerequisites as needed:
.mjt system install tar
.mjt system install python
.mjt system install proot
.mjt system install proot-distro
Use shell commands through the command namespace:
.command pwd
.command ls -la
.command java -version
The exact available commands depend on the current branch and enabled services.
MJT separates internal commands from host-shell commands.
| Purpose | Example |
|---|---|
| MJT help | .mjt help |
| Shell command | .command ls -la |
| Start Minecraft target | .mjt minecraft start |
| Install TAR | .mjt system install tar |
| Install Python | .mjt system install python |
| Install PRoot | .mjt system install proot |
| Install proot-distro | .mjt system install proot-distro |
This separation reduces accidental execution of host commands and keeps administrative actions explicit.
Portable runtime archives are extracted through a TAR command rather than a custom archive parser.
Resolution order:
- existing MJT-managed TAR launcher;
- host
tar,bsdtar, or BusyBox TAR; - supported host package-manager installation;
- static fallback bootstrap selected for the detected Linux CPU architecture.
MJT selects an upstream portable CPython asset that matches the detected Linux target triple. Downloads are verified against published SHA-256 metadata before installation.
MJT can install a native PRoot binary for supported Linux architectures and validates it before use.
MJT uses upstream proot-distro as a separate component for rootless guest-environment management. MJT does not claim ownership of that upstream project.
See Third-Party Notices for licensing and attribution.
MJT can use cloudflared for tunnel workflows. Tunnel connectivity and public hostname routing depend on the Cloudflare configuration and the host network policy.
MJT can run an embedded SSH server for controlled workspace access. Always use a strong password or key-based authentication where supported, avoid exposing the service without a firewall/tunnel policy, and restart the SSH service after changing credentials.
- Do not store tunnel tokens, passwords, or API credentials in source control.
- Keep runtime downloads checksum-verified.
- Prefer trusted upstream assets and pinned URLs where appropriate.
- Treat remote shell access as production-sensitive.
- Restrict public ports and use tunnels or access policies when possible.
- Review third-party licenses before bundling, modifying, or redistributing dependencies.
MJT may install, invoke, or integrate with third-party tools. Their licenses remain independent from the MJT source license.
MJT acknowledges and thanks the Termux proot-distro project:
- Upstream repository: https://github.com/termux/proot-distro
- Purpose: rootless Linux container management on Termux and regular Linux hosts
- Upstream license: GNU General Public License, version 3.0 (GPL-3.0)
proot-distro is a separate upstream component. When MJT downloads, executes, bundles, redistributes, modifies, or incorporates its code, the applicable GPL-3.0 obligations for that component must be preserved.
See THIRD_PARTY_NOTICES.md for the project notice and distribution guidance.
Important licensing boundary: MJT's own original source is released under MIT. This does not relicense GPL-3.0 code. If GPL-3.0 source from
proot-distrois copied into or linked as part of an MJT distribution, the resulting distribution may need to be licensed and distributed under GPL-3.0 terms. Keep GPL components separate unless you have reviewed the applicable obligations.
Full Changelog: https://github.com/mjt-project/Mini-Java-Terminal/compare/2.5.0...3.0.0-SNAPSHOT+16
MJT original source code is licensed under the MIT License.
Third-party components retain their own licenses. In particular, upstream proot-distro is GPL-3.0 licensed; see THIRD_PARTY_NOTICES.md.
This project is actively evolving. Before opening a pull request:
- Build with Java 17.
- Run
mvn -U clean package. - Keep managed-runtime changes isolated and test on a supported Linux host.
- Do not commit credentials, tunnel tokens, or generated runtime directories.
- Include clear notes for changes affecting installers, storage layout, or public networking.
MJT is provided as-is, without warranty. Hosting providers may restrict processes, filesystems, networking, symlinks, ports, package managers, or executable permissions. Always comply with the terms and technical limits of the host platform.