=====
A Java Virtual Machine implementation written in JavaScript, including libraries for Java, Scala and Closure.
The main thread hosts the UI while all the bytecode parsing and program execution takes place in a web worker to keep things responsive. When a non-present class definition is encoutered, the classloader will attempt to download the bytecode of the required class, otherwise the upfront load times would be outrageous.
The initial class loads you see on the demo page are setting up java.lang.System.out which will write to the log window in the bottom right.
http://achingbrain.github.io/jvm.js. Skip to step 4 below. Hope you're running a modern browser.
-
Install dependencies
npm install
-
Run web server
grunt run
-
Drop a .class file with a main method file onto the box marked "Drop a .class file here"
-
Set some breakpoints and hit run
Run test suite:
grunt test
Run test suite with coverage (report appears in /target/reports/coverage/index.html):
grunt coverage
Delete the "target" directory
grunt clean
Rather a lot.
- Threading, files, sockets, etc.
- High value longs, doubles, etc.
Rather a lot
- Test invoke_dynamic with some code that uses it (e.g. not Java)
- Support ConstantValue field attribute
- Implement step-into and step-out functionality