Ask coding questions

← Back to all posts
Help, JWebAssembly is being weird
EpicGamer007 (1607)

Ok, so i was hoping to get into WASM using java. I found this really cool package called JWebAssembly. I tried it before but I got confused and stopped. Today, I tried using it again. It took ages to get the classpath working, but it finally did. Now though, I have a problem. Whenever I try to convert to binary, i just get a weird js output with a file called Code.wasm.js and the class file ends up with some weird text saying it was converted to wasm or something. when i try to convert my code to wat, i get

(module

)

I do not understand why the JWebAssembly is not working. If anyone could help, that would be great. (it would be easier to work with if you fork the repl).

Thanks to all answers ;)

Comments
hotnewtop
xxpertHacker (855)

Were you able to get their hello world example working? It might be best to start with that, as that's what hello world programs are for: to make sure that the environment and compiler work correctly.

19wintersp (1121)

@EpicGamer007 This is probably your best solution; I don't know why you're using the raw API, because I can't seem to find any references to it in the documentation, so my only suggestion would be to follow that guide and use Gradle.

EpicGamer007 (1607)

@19wintersp im not sure if grade is on replit, is it?

19wintersp (1121)

@EpicGamer007 I personally haven't used it on Replit, but then again I've only used Java on Replit once or twice. I think you should be able to, with install-pkg or the like.

EpicGamer007 (1607)

@19wintersp ok, i will take a look at it