New:Introducing Socket Scanning for VS Code Marketplace Extensions.Learn more →
Get Started

@project516/java-web

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@project516/java-web

Run Java 25 bytecode in the browser on a JavaScript JVM and the real OpenJDK class library

latest
Source
npmnpm
Version
0.1.1
Version published
Maintainers
1
Created
Source

java-web

A JVM written in TypeScript that runs Java 25 class files and JARs in the browser and under Node. It runs the real OpenJDK 25 class library unmodified, and its page API matches CheerpJ's, so existing pages can switch.

Use it in a page

pnpm add @project516/java-web

Serve node_modules/@project516/java-web/dist/ as static files, then:

<script src="java-web.js"></script>
<pre id="console"></pre>
<script type="module">
  await cheerpjInit();
  await cheerpjRunJar("/app/my-app.jar");   // /app/ is the web server root
</script>

cheerpjRunMain, cheerpjRunLibrary (call Java from JS), JS natives and /files/ storage work too. See docs/browser.md.

Use it under Node

npx @project516/java-web -cp classes Main          # or: npx @project516/java-web -jar app.jar
import { runNode } from "@project516/java-web";
const code = await runNode({ classpath: ["classes"], mainClass: "Main" });

See docs/node.md.

What runs

  • Console apps, libraries and javac: every Java SE module, plus jdk.compiler, jdk.httpserver and a few more.
  • The headless parts of java.desktop, including Graphics2D on a BufferedImage, with HotSpot's pixels except for text.
  • Sockets: real ones under Node; in the browser, loopback inside the VM and http:/https: through fetch.
  • Not yet: AWT and Swing windows, child processes, IPv6.

Details: docs/support.md.

Develop

You need Node 23.6+, pnpm, curl and bzip2 on Linux or macOS.

pnpm install
pnpm jdk          # downloads the pinned JDK 25 and builds the image
pnpm test         # compares programs against HotSpot
pnpm build        # builds dist/

More: docs/development.md.

License

AGPL-3.0-only. The OpenJDK class library is GPL-2.0 with the Classpath Exception, and the bundled DejaVu Sans font has its own license; both notices ship in dist/jdk/legal/.

Keywords

java

FAQs

Package last updated on 02 Nov 2026

Related posts