javac on WebAssembly

This demo can turn Java source code into JVM bytecode, which you can then download or disassemble. For this, the demo uses the Java compiler (javac) on WebAssembly generated by GraalVM. It was shown as part of this talk at Wasm I/O 2025.
Note: This version of the demo has some rough edges, but we might improve it over time. Currently, the content of this text box will be written into a HelloWasm.java file. A valid program needs to use public class HelloWasm or only declare non-public classes.
  public class HelloWasm {
      public static void main(String[] args) {
          System.out.println("Hello from WebAssembly generated with GraalVM!");
      }
  }

                
                
                

            
Code on GitHub