I am trying to compile Java to WebAssembly. Is this possible? My initial approach was to take the example described in this blog post
The approach described in the blog post is as follows:
- Install GraalVM and add native-image and LLVM toolchain to the installation
- Use GraalVM's javac to compile a simple program (into a class file)
- Use GraalVM's native-image program to process the class file into a native binary (with options to preprocess using llvm)
- Use the LLVM IR bit code files to compile as WASM binary.
I get to step 4 but after that I can't compile the LLVM IR bit code to wasm.
I get the following error from LLVM:
LLVM ERROR: unsupported GC: compressed-pointer
Has anyone tried this and succeeded?