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.
- (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.
git clone [email protected]:Tsukuba-Programming-Lab/BJVM.git
# in root
npm i
# in (root)/web
cd web
npm i
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
cd bjvm-wasm
cargo watch -- npm run build:release
cd bjvm-console
npm run dev