Porting to Browser

Just wanted to put this here for future reference.

From the little bit Ive researched into getting JME built with GWT, getting everything working in the browser could be quite a lot of work. GWT is only a compiler framework converting from java code to javascript. For classes in the java standard library that you want to use, you would have to implement them and then tell GWT to use them at compile time. There is a small subset of emulated JRE std library classes in the standard distribution. However, some of the more important ones like java.lang.Thread are not there.

The libGDX guys got around this by implementing a substantial amount of the JRE classes themselves. So any effort for JME could use some of that code, I suppose.

Its not impossible, it will just be a lot of work. I think some changes will be needed in the core as well to mitigate any existing dependence on multithreading, if that’s even possible. I dont know to what extent JME uses or requires multithreading. So at least some support from the core team will be required, even if its just moral/advisory support.

Also, integration with native bullet will probably need bullet to be compiled with emscripten (not difficult) and then have the glue code written in native GWT methods to bind everything together. Im also not sure if the

There is one thing, though. The future of GWT seems a bit uncertain. Google is still using it for things like Google Developer Console and Google Adwords and stuff like that. But development on the project does appear somewhat stagnant. But it is quite solid and robust.

1 Like