Skip to content

DomWilliams0/jvm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

jvm

Toy JVM that might be useful. Uses GNU Classpath.

Progress

Usage

Not recommended in its current state

A nightly rust compiler is required for variadic functions in the JNI interface.

  • Download, build and install GNU Classpath
    • I had luck with the following commands: CFLAGS="-w" ./configure --enable-load-library=yes --with-glibj=flat --enable-jni=yes --disable-gjdoc && make && make install
    • I also had to install antlr 3.5.2, gconf 2.6.0 and downgrade to a JDK that still has javah (OpenJDK 8)
  • Find/compile a simple .java file into a .class
  • cargo run -- <class name> --Xbootclasspath <colon separated list of paths to system classes> --cp <colon separated list of paths for non-system classes>
    • Example: cargo run -- com.me.MyClass --Xbootclasspath /gnuclasspath:../java --cp ../java. This will (try to) run the main method of ../java/com/me/MyClass.class
    • See help menu for more: cargo run -- --help

About

☕ JVM written in Rust

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Languages