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.
- No clone, No copy (except for Rc)
- (root)
- src: Main codes for BJVM
- web: Debugger for Web Browsers
- some setting files...
git clone git@github.com: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.0.11
cargo watch -- npm run build
# in root
npm run dev
And open http://localhost:5173 . You can debug on the "Console" tab in DevTools:
