Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ and its page API matches CheerpJ's, so existing pages can switch.
## Use it in a page

```sh
pnpm add java-web
pnpm add @project516/java-web
```

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

```html
<script src="java-web.js"></script>
Expand All @@ -27,11 +27,11 @@ Serve `node_modules/java-web/dist/` as static files, then:
## Use it under Node

```sh
npx java-web -cp classes Main # or: npx java-web -jar app.jar
npx @project516/java-web -cp classes Main # or: npx @project516/java-web -jar app.jar
```

```js
import { runNode } from "java-web";
import { runNode } from "@project516/java-web";
const code = await runNode({ classpath: ["classes"], mainClass: "Main" });
```

Expand Down
2 changes: 1 addition & 1 deletion docs/browser.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Using java-web in a page

The npm package holds the built files: `java-web.js`, `java-web-worker.js`,
`boot.pack` and `jdk/` for pages, and `node.js` for Node ([node.md](node.md)). Serve `node_modules/java-web/dist/` as static files
`boot.pack` and `jdk/` for pages, and `node.js` for Node ([node.md](node.md)). Serve `node_modules/@project516/java-web/dist/` as static files
and load `java-web.js` with a classic `<script>` tag. It finds the other files
next to itself, or where `cheerpjInit({ runtime: "/path/to/dist/" })` says.

Expand Down
6 changes: 3 additions & 3 deletions docs/node.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ system is the VFS root, and Java sees the host's environment.
## Command

```sh
npx java-web [options] Main [args]
npx java-web [options] -jar app.jar [args]
npx @project516/java-web [options] Main [args]
npx @project516/java-web [options] -jar app.jar [args]
```

| Option | Meaning |
Expand All @@ -28,7 +28,7 @@ Other `-X` and HotSpot-only options are ignored.
## From JS

```js
import { runNode } from "java-web";
import { runNode } from "@project516/java-web";

const out = [];
const code = await runNode({
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "java-web",
"name": "@project516/java-web",
"version": "0.1.0",
"description": "Run Java 25 bytecode in the browser on a JavaScript JVM and the real OpenJDK class library",
"keywords": [
Expand Down
Loading