Skip to content

Wasm 向け Java17 実装 / JSSST PPL2025 C1, C3

Notifications You must be signed in to change notification settings

Tsukuba-Programming-Lab/BJVM

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BJVM

BJVM (Browser-based JVM) is an implementation of JVM (Based on The Java® Virtual Machine Specification - Java SE 17 Edition -). This project is focusing on running Java on Web Browsers, so it is implemented in Rust and being able to run with WebAssembly.

File Structure

  • (root)
    • bjvm: A npm library including bJVM (JS) and bJVM (Wasm); The main artifact of this project.
    • bjvm-wasm: A main implementation of JVM, especially bJVM (Wasm).
    • bjvm-console: A web-based debugger for bJVM.

Setup

Clone

git clone [email protected]:Tsukuba-Programming-Lab/BJVM.git

Install Libraries for Node.js

# in root
npm i

# in (root)/web
cd web
npm i

(Optional) Install OpenJDK 17

To compile *.java files compatible with BJVM, you need to install OpenJDK 17.

brew install openjdk@17

If you use other versions of JDK, you have to create .zshrc file into the root and execute below commands to use OpenJDK 17 under this project.

.zshrc

JAVA_HOME=$(/usr/libexec/java_home -v 17)
PATH=${JAVA_HOME}/bin:${PATH}

and execute:

# Create symbolic link
sudo ln -sfn /opt/homebrew/opt/openjdk@17/libexec/openjdk.jdk /Library/Java/JavaVirtualMachines/openjdk-17.jdk

# Check if OpenJDK 17 is solved by the system
/usr/libexec/java_home -V  # 17.0.11 (arm64)...

# And reload .zshrc
source .zshrc

Lastly, check if current OpenJDK version is 17.x.

java -version  # 17.x

Development

Automatic Building for bJVM (Wasm)

cd bjvm-wasm
cargo watch -- npm run build:release

Run dev Server for the debugger

cd bjvm-console
npm run dev

About

Wasm 向け Java17 実装 / JSSST PPL2025 C1, C3

Topics

Resources

Stars

Watchers

Forks

Languages