Skip to content
tuanworlddevPublic

About

Cross-platform desktop apps with a Java 25 core and the operating system WebView.

Topics

Resources

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

116 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

JDesk

JDesk is a desktop application framework built with a Java 25 application core, a web frontend, and the native WebView supplied by each operating system.

Applications keep business logic, system integration, lifecycle handling, and packaging in Java. The user interface can use vanilla HTML/TypeScript or frameworks such as React, Vue, and Svelte.

Features

  • Native system WebViews: WebView2 on Windows, WKWebView on macOS, and WebKitGTK on Linux.
  • Java 25, JPMS modules, virtual threads, and Foreign Function & Memory API adapters.
  • Asynchronous Java-to-JavaScript commands and events with compile-time generated bindings.
  • TypeScript client with request correlation, cancellation, timeouts, and navigation reset.
  • Deny-by-default capabilities and per-window permission grants.
  • Strict navigation policy and a production-only jdesk://app/ asset protocol with HTTP Range (206), configurable CSP, and app-defined Java-served asset routes.
  • Binary pull-streaming with backpressure (BinaryStream → invokeStream), verified live at 2 GiB.
  • OS-backed secret storage (macOS Keychain, Windows DPAPI, Linux Secret Service).
  • Structured command errors (error.data) and a page-console-to-Java logging bridge.
  • Optional automation module for E2E tests, CI, and agents (jdesk-automation plus -Djdesk.automation=true); production images carry no HTTP server.
  • Window minimum size, start-maximized, and remembered bounds across runs.
  • Frontend HMR through the configured frontend development server — or a zero-Node dev loop with automatic in-app reload for static frontends.
  • Automatic Java/resource rebuild and controlled process restart through jdeskDev.
  • basic, structured, Vanilla/Vite, React, Vue, Svelte, Solid, and Maven templates.
  • Runtime images with jlink and native application/installer packaging with jpackage.
  • SHA-256 checksums and a CycloneDX SBOM for packaged applications.

Platform Support

Platform WebView Minimum target Verification
Windows x64 WebView2 Windows 10 1809 Native, package, security, and stress tests on a real CI runner
macOS ARM64 WKWebView macOS 13 Native, package, security, and stress tests on real Apple Silicon hardware
Linux x64 WebKitGTK 4.1 Ubuntu 22.04 Native, package, security, and stress tests on a real CI runner

See VERIFICATION.md for recorded evidence and platform prerequisites for operating-system setup.

Requirements

  • JDK 25. The JDK must include jlink and jpackage when building desktop packages.
  • Node.js and npm when the selected frontend uses Vite or another Node-based toolchain.
  • The platform WebView runtime:
    • Windows: Microsoft Edge WebView2 Runtime.
    • macOS: system WKWebView; no additional runtime installation is required.
    • Linux: WebKitGTK 4.1, for example sudo apt-get install libwebkit2gtk-4.1-0.

Quick Start

Scaffold a new app with the published npm CLI — the same flow as create-vite / create-next-app:

npm create jdesk-app@latest my-app
# or
npx create-jdesk-app@latest my-app

It walks you through a guided setup (project name, package id, build system, template) and prints the commands to run. See create-jdesk-app on npm.

JDesk libraries and the Gradle plugin marker are public on Maven Central. The generated build uses mavenCentral() and requires no repository credentials. See scaffolding and publishing for release details.

Install From Source

Alternatively, build the CLI from a local checkout of this repository:

Build and test the framework:

./gradlew clean check

Build the CLI distribution:

./gradlew :modules:jdesk-cli:installDist

The CLI is created at:

modules/jdesk-cli/build/install/jdesk/bin/jdesk

On macOS or Linux, add it to the current shell's PATH:

export JDESK_HOME="$PWD"
export PATH="$JDESK_HOME/modules/jdesk-cli/build/install/jdesk/bin:$PATH"
jdesk --help

On Windows PowerShell:

$env:JDESK_HOME = (Get-Location).Path
$env:Path = "$env:JDESK_HOME\modules\jdesk-cli\build\install\jdesk\bin;$env:Path"
jdesk.bat --help

Create An Application

Use the npm CLI (recommended). Run it with no arguments for a guided setup:

npx create-jdesk-app@latest

It asks for the project name, Java package (default com.example.<name>, press Enter to accept), build system (Gradle — full tooling, or Maven — build + run), and, for Gradle, a frontend template (arrow keys): basic, vanilla, react, vue, svelte, or structured. Or pass everything as flags:

npx create-jdesk-app@latest my-app --template react --package com.example.myapp
npx create-jdesk-app@latest my-suite --template structured
npx create-jdesk-app@latest my-app --maven          # Maven instead of Gradle

Then:

cd my-app
./gradlew run          # launch the app on this OS (Gradle)
./gradlew dev          # dev loop with frontend hot-reload

Debugging the WebView UI. When the UI gets non-trivial, two launch flags make it observable from outside — ./gradlew run forwards any -Djdesk.* flag to the app:

./gradlew run -Djdesk.console.forward=true   # page console.* + JS errors -> the app log
./gradlew run -Djdesk.automation=true        # token-gated HTTP endpoint to drive & snapshot

See Automate and E2E-test your app and, for a game/dashboard, Build a networked / real-time app.

You can also use the bundled Java CLI from a source checkout (jdesk create my-app --template basic --package com.example.myapp --jdesk-source "$JDESK_HOME"); --jdesk-source wires the generated project to the local framework as a Gradle composite build for framework development.

Each generated project includes:

  • Gradle wrapper + JDK 25 toolchain (or a pom.xml for the Maven build system).
  • A short run task and aliases (run, dev, doctor, bindings, pkg).
  • A capability policy and a sample typed Java command.
  • A frontend (plain HTML/JS, or Vite + React/Vue/Svelte) and a production asset builder.
  • Development, packaging, and installer tasks from dev.jdesk.application.

Single-module templates are classpath apps (no module-info.java); the structured template is modular.

Development

Install the generated frontend dependencies once:

cd my-app
npm install --prefix ui

Start the frontend server and desktop application:

./gradlew jdeskDev

For a structured project:

./gradlew :desktop:jdeskDev

Frontend changes are applied by Vite HMR. Java and resource changes run the project's classes task and restart the Java application only after a successful build. If a build fails, the existing application remains running while the source is corrected.

Development settings can be customized in build.gradle.kts:

jdesk {
    development {
        javaReload.set(true)
        reloadDebounceMillis.set(300)
        // reloadCommand.set(listOf("./gradlew", "classes"))
        // reloadSources.from(rootProject.file("another-module/src/main"))
    }
}

Build And Package

Check the local environment before packaging:

./gradlew jdeskDoctor

Compile the application and frontend:

./gradlew classes

Create a platform application image:

./gradlew jdeskPackage

Create a native installer on the current operating system:

./gradlew jdeskInstaller

The installer task supports DMG/PKG on macOS, MSI/EXE on Windows, and DEB/RPM on Linux. Current generated installers are unsigned unless signing credentials are configured. See packaging and signing.

Repository Layout

  • modules/jdesk-api: public Java application API.
  • modules/jdesk-runtime: lifecycle, IPC, capabilities, assets, and runtime coordination.
  • modules/jdesk-platform-*: Windows, macOS, and Linux WebView adapters.
  • modules/jdesk-codegen: Java command registry and TypeScript binding generator.
  • modules/jdesk-gradle-plugin: development, build, and packaging tasks.
  • modules/jdesk-cli: project generator and bundled templates.
  • js/jdesk-client: TypeScript IPC client.
  • examples: example applications.
  • test-apps: native, security, and packaging probes.
  • docs: architecture, development, security, packaging, and verification documentation.

Project Status

JDesk is pre-alpha and under active development. The core runtime and primary platform adapters are implemented and tested. Version 0.1.3 was published from one verified tag to Maven Central, npm and GitHub Releases. Its first Gradle Plugin Portal submission is awaiting Gradle's manual approval, so Gradle's public marker is the only remaining 0.1.3 registry gate. Signed/notarized installers and secondary CPU architectures remain pending. CI includes Windows, Linux, and macOS ARM64 native/security/package gates.

The repository also includes a reviewed public-API baseline, signed-manifest update coordination with health rollback, enterprise managed runtime policy, bounded redacted support bundles, CycloneDX 1.7 inventory, CodeQL/Dependabot automation, installer payload validation and native startup/latency/RSS regression budgets. See the release and support policy before depending on a pre-1.0 line.

See STATUS.md, ROADMAP.md, and VERIFICATION.md for the current state, completion criteria, and evidence.

License

Apache-2.0. See LICENSE.

About

Cross-platform desktop apps with a Java 25 core and the operating system WebView.

Topics

Resources

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages