Skip to content

Commit 658f339

Browse files
Merge branch 'jdk21'
# Conflicts: # webswing-directdraw/webswing-directdraw-javascript/package-lock.json
2 parents cca4f7d + 5ecb982 commit 658f339

175 files changed

Lines changed: 20707 additions & 24252 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflow/Gradle.yml

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
name: Build
2+
3+
on:
4+
push:
5+
branches: [ master, develop ]
6+
pull_request:
7+
branches: [ master ]
8+
workflow_dispatch:
9+
10+
permissions:
11+
contents: read
12+
13+
jobs:
14+
build:
15+
name: Build on JDK ${{ matrix.java }} / ${{ matrix.os }}
16+
runs-on: ${{ matrix.os }}
17+
strategy:
18+
fail-fast: false
19+
matrix:
20+
java: [ '21', '25' ]
21+
os: [ ubuntu-latest ]
22+
23+
steps:
24+
- name: Checkout
25+
uses: actions/checkout@v4
26+
27+
- name: Set up JDK ${{ matrix.java }}
28+
uses: actions/setup-java@v4
29+
with:
30+
distribution: temurin
31+
java-version: ${{ matrix.java }}
32+
33+
- name: Set up Xvfb
34+
run: |
35+
sudo apt-get update -qq
36+
sudo apt-get install -y -qq xvfb
37+
Xvfb :99 -screen 0 1024x768x24 &
38+
echo "DISPLAY=:99" >> "$GITHUB_ENV"
39+
40+
- name: Cache Gradle packages
41+
uses: actions/cache@v4
42+
with:
43+
path: |
44+
~/.gradle/caches
45+
~/.gradle/wrapper
46+
~/.gradle/nodejs
47+
key: gradle-${{ runner.os }}-jdk${{ matrix.java }}-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties', '**/gradle.properties') }}
48+
restore-keys: |
49+
gradle-${{ runner.os }}-jdk${{ matrix.java }}-
50+
gradle-${{ runner.os }}-
51+
52+
- name: Cache Node modules
53+
uses: actions/cache@v4
54+
with:
55+
path: |
56+
webswing-directdraw/webswing-directdraw-javascript/node_modules
57+
webswing-server/webswing-server-frontend/node_modules
58+
key: node-${{ runner.os }}-${{ hashFiles('**/package-lock.json', '**/package.json') }}
59+
restore-keys: |
60+
node-${{ runner.os }}-
61+
62+
- name: Grant execute permission
63+
run: chmod +x gradlew
64+
65+
- name: Build
66+
run: ./gradlew clean build --no-daemon --warning-mode all
67+
68+
- name: Upload distribution
69+
if: matrix.java == '21' && github.event_name == 'push'
70+
uses: actions/upload-artifact@v4
71+
with:
72+
name: webswing-distribution
73+
path: webswing-assembly/dist/webswing-*-distribution.zip
74+
retention-days: 14
75+
if-no-files-found: warn

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,15 @@
22
# compiled source #
33
###################
44
target/
5+
build/
6+
out/
57
dist/
68
bin/
79
lib/
810
logs/
911
node/
1012
node_modules/
13+
.gradle/
1114
.settings/
1215
.project
1316
.classpath

README.md

Lines changed: 214 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,229 @@
1-
![logo2.png](https://bitbucket.org/repo/ypeqyM/images/2077889959-logo2.png)
1+
<div align="center">
22

3-
**Webswing** is a web server that allows you to run any Java swing application inside your web browser using only pure HTML5.
3+
# WebSwing Lite
44

5-
The best days of swing framework are gone. Desktop applications lost popularity and everything is forced to be online and mobile. But what about existing application? Using applet technology proved to be insecure, and rewriting the application to web is too expensive. This is where Webswing can help you. With Webswing, your application is securely running on a server and a user's browser only displays the application window. All this without changing a single line of source code.
5+
### Enterprise Java Swing Applications — Delivered Through Your Browser
66

7-
## Attribution
7+
[![Build](https://github.com/manticore-projects/webswing/actions/workflows/Gradle.yml/badge.svg)](https://github.com/manticore-projects/webswing/actions/workflows/Gradle.yml)
8+
[![Version](https://img.shields.io/badge/Version-26.0-orange?style=for-the-badge)](https://github.com/manticore-projects/webswing/releases)
9+
[![JDK 13+](https://img.shields.io/badge/JDK-13%2B%20%7C%2021%20%7C%2025%20%7C%2026-blue?style=for-the-badge&logo=openjdk&logoColor=white)](https://openjdk.org/)
10+
[![Node.js 24](https://img.shields.io/badge/Node.js-24%20LTS-339933?style=for-the-badge&logo=nodedotjs&logoColor=white)](https://nodejs.org/)
11+
[![License: AGPL v3](https://img.shields.io/badge/License-AGPL%20v3-red?style=for-the-badge)](https://www.gnu.org/licenses/agpl-3.0)
12+
[![Build](https://img.shields.io/badge/Build-Gradle%20%7C%20Maven-02303A?style=for-the-badge&logo=gradle&logoColor=white)](https://gradle.org/)
13+
[![GitHub](https://img.shields.io/github/stars/manticore-projects/webswing?style=for-the-badge&logo=github)](https://github.com/manticore-projects/webswing)
14+
15+
<br/>
16+
17+
*Run any Java Swing application inside a modern web browser — pure HTML5, zero plugins, zero client-side installation.*
18+
19+
<br/>
20+
21+
[Getting Started](#-getting-started) · [Build](#-build-instructions) · [What's New](#-whats-new) · [Architecture](#-architecture) · [Commercial Edition](#-commercial-edition)
22+
23+
---
24+
25+
</div>
26+
27+
## Overview
28+
29+
**WebSwing Lite** is a modernized, open-source edition of [WebSwing](https://www.webswing.org) — the web server that renders Java Swing applications in HTML5 Canvas and delivers them to any browser via WebSocket.
30+
31+
This edition is based on the **last open-source release (v20.2.5)** of WebSwing, updated and maintained by [Manticore Projects](https://github.com/manticore-projects) with a focus on **modern JDK compatibility**, **security**, and **build toolchain modernization**.
32+
33+
> **Looking for the full-featured commercial edition?**
34+
> WebSwing Lite does not include advanced capabilities such as cluster session pooling, load balancing, recording/playback, advanced admin console, and commercial support.
35+
> For production deployments at scale, we encourage you to explore the [**Commercial Edition at webswing.org**](https://www.webswing.org)
36+
37+
---
38+
39+
## ✦ What's New
40+
41+
### JDK Compatibility
42+
43+
| JDK | Status | Notes |
44+
|:---:|:------:|:------|
45+
| 13–17 | 🔶 Should work | Untested — community feedback welcome |
46+
| 21 (LTS) | ✅ Fully supported | Primary target |
47+
| 23 | ✅ Supported | Short-term release |
48+
| 25 (LTS) | ✅ Supported | Current LTS |
49+
| 26 | ✅ Supported | Requires `--sun-misc-unsafe-memory-access=allow` |
50+
51+
All internal APIs adapted for the post-JDK-11 module system — no `--illegal-access=permit`, no `-noverify` required.
52+
53+
### Build & Runtime Modernization
54+
55+
- **Node.js 24 LTS** — migrated from Node 10; Webpack 5, TypeScript 5, Dart Sass
56+
- **Gradle build system** — fast, incremental builds alongside the existing Maven build (Maven will be phased out in a future release)
57+
- **All dependencies updated** — Jackson, Guava, Log4j2, SLF4J 2.0, Bouncy Castle, Apache Commons, Protocol Buffers, and more
58+
- **Modernized start/stop script**`bash` strict mode, graceful shutdown with timeout, Xvfb lifecycle management, clean log rotation
59+
60+
### Performance
61+
62+
- **SSE/AVX-optimized PNG encoding** via [fpng-java](https://github.com/nicob/fpng-java) — hardware-accelerated image compression in the DirectDraw rendering pipeline
63+
- **Browser-side font rendering** — text is rendered as font names + coordinates instead of server-side glyph bitmaps, reducing WebSocket bandwidth by up to 80%
64+
65+
### Security
66+
67+
- **Apache Shiro integration** — pluggable authentication and authorization supporting Active Directory / LDAP, JDBC realms, and custom providers
68+
- **TLS/SSL** — full HTTPS and WSS support with configurable keystores and truststores
69+
70+
### Roadmap
71+
72+
- Migration to **Jetty 12** (EE8 environment for `javax.servlet` compatibility)
73+
- Migration to **Apache HttpClient 5** replacing the legacy 4.x client
74+
- `PlatformGraphicsInfo` module patch integrated into the build system (replacing the runtime `Unsafe` workaround)
75+
76+
---
77+
78+
## 🚀 Getting Started
79+
80+
### Prerequisites
81+
82+
| Component | Version |
83+
|-----------|---------|
84+
| JDK | 13 or later (21+ recommended; [Eclipse Temurin](https://adoptium.net/)) |
85+
| Xvfb | Required on headless Linux servers |
886

9-
In case you are using Webswing to deliver your product **give a credit and a create link on your page to webswing.org!**
87+
### Quick Start
1088

11-
## Contribution
89+
```bash
90+
# Download the latest release
91+
curl -LO https://github.com/manticore-projects/webswing/releases/latest/download/webswing-26.0-distribution.zip
92+
unzip webswing-26.0-distribution.zip
93+
cd webswing-26.0
1294

13-
If you want to contribute to Webswing, be sure to review the [contribution guidelines](http://webswing.org/docs/version-2.5/contrib/).
14-
We use [bitbucket issues](https://bitbucket.org/meszarv/webswing/issues) for tracking requests and bugs.
95+
# Start the server
96+
./run.sh start
1597

16-
## Links
98+
# Open in your browser
99+
open http://localhost:8080
100+
```
17101

18-
[Webswing Website](https://www.webswing.org)
102+
### Management
19103

20-
[Documentation](https://webswing.org/docs/)
104+
```bash
105+
./run.sh start # Start the server (background, with log tailing)
106+
./run.sh stop # Graceful shutdown (30s timeout, then SIGKILL)
107+
./run.sh restart # Stop + Start
108+
./run.sh status # Check if the server is running
109+
```
21110

22-
[Downloads](https://www.webswing.org/downloads)
111+
---
23112

24-
[Webswing Promo Video - Youtube](https://youtu.be/IpYlyCRZcxc)
113+
## 🔨 Build Instructions
25114

26-
[Webswing Quickstart Guide Video - Youtube](https://youtu.be/TKFJEfBBpKI)
115+
### Prerequisites
116+
117+
| Tool | Version |
118+
|--------|---------|
119+
| JDK | 21+ |
120+
| Gradle | 8.12 |
121+
| Git | 2.x |
122+
123+
> Node.js and npm are **automatically downloaded** during the build — no manual installation needed.
124+
125+
### Build with Gradle
126+
127+
```bash
128+
# Clone the repository
129+
git clone https://github.com/manticore-projects/webswing.git
130+
cd webswing
131+
132+
# Full build
133+
./gradlew clean build
134+
135+
# Build specific modules
136+
./gradlew :webswing-directdraw:webswing-directdraw-javascript:build
137+
./gradlew :webswing-server:webswing-server-frontend:build
138+
```
139+
140+
### Deploy
141+
142+
```bash
143+
# Extract to your deployment directory
144+
unzip webswing-assembly/dist/webswing-26.0-distribution.zip -d /opt/webswing
145+
146+
# Configure your Swing application in webswing.config
147+
vim /opt/webswing/webswing.config
148+
149+
# Start
150+
cd /opt/webswing && ./run.sh start
151+
```
152+
153+
---
154+
155+
## 🏗 Architecture
156+
157+
```
158+
┌─────────────────────────────────────────────────────────────┐
159+
│ Browser │
160+
│ ┌───────────────────────────────────────────────────────┐ │
161+
│ │ HTML5 Canvas ◄──── WebSocket ────► Event Capture │ │
162+
│ └───────────────────────────────────────────────────────┘ │
163+
└─────────────────────────────────┬───────────────────────────┘
164+
165+
┌─────────────▼─────────────┐
166+
│ WebSwing Server │
167+
│ (Jetty 9 / Servlet) │
168+
│ │
169+
│ ┌──────────────────────┐ │
170+
│ │ Session Manager │ │
171+
│ │ Security (Shiro) │ │
172+
│ │ WebSocket Handler │ │
173+
│ └──────────┬───────────┘ │
174+
└─────────────┼──────────────┘
175+
│ spawns
176+
┌─────────────▼─────────────┐
177+
│ Child JVM Process │
178+
│ │
179+
│ ┌──────────────────────┐ │
180+
│ │ WebToolkit (AWT) │ │
181+
│ │ DirectDraw Pipeline │ │
182+
│ │ Font Renderer │ │
183+
│ │ ────────────────── │ │
184+
│ │ Your Swing App │ │
185+
│ └──────────────────────┘ │
186+
└────────────────────────────┘
187+
```
188+
189+
**How it works:** The server intercepts Java2D `Graphics2D` paint operations in the child JVM, serializes them via Protocol Buffers, and streams them over WebSocket to the browser. The browser's JavaScript engine deserializes and replays the draw commands on an HTML5 Canvas. User input (mouse, keyboard) flows back over the same WebSocket.
190+
191+
---
192+
193+
## 📦 Dependency Overview
194+
195+
| Component | Version | Purpose |
196+
|-----------|---------|---------|
197+
| Jetty | 9.4.58 | Embedded HTTP/WebSocket server |
198+
| Jackson | 2.19.0 | JSON serialization |
199+
| Protocol Buffers | 3.25.5 | Binary wire format (DirectDraw) |
200+
| Apache Shiro | 1.13.0 | Authentication & authorization |
201+
| Guava | 33.5.0 | Core utilities |
202+
| Log4j 2 | 2.25.3 | Logging framework |
203+
| SLF4J | 2.0.17 | Logging facade |
204+
| Bouncy Castle | 1.80 | Cryptography |
205+
| Webpack | 5.x | JavaScript bundling |
206+
| TypeScript | 5.x | Type-safe frontend code |
207+
208+
209+
---
210+
211+
## Attribution
212+
213+
This project is based on [WebSwing](https://www.webswing.org) v20.2.5, the last open-source release under the AGPL v3 license. All credit for the original WebSwing architecture and implementation goes to the WebSwing team.
214+
215+
If you use WebSwing Lite to deliver your product, **please provide attribution and a link to [webswing.org](https://www.webswing.org).**
27216

28217
## License
29218

30-
[GNU Affero General Public License](https://www.gnu.org/licenses/agpl-3.0.en.html)
219+
This project is licensed under the [GNU Affero General Public License v3.0](https://www.gnu.org/licenses/agpl-3.0.en.html).
220+
221+
---
222+
223+
<div align="center">
224+
225+
**Maintained by [Manticore Projects](https://github.com/manticore-projects)**
226+
227+
*Building enterprise financial software for banks and insurances since 2014.*
228+
229+
</div>

bitbucket-pipelines.yml

Lines changed: 0 additions & 14 deletions
This file was deleted.

0 commit comments

Comments
 (0)