I think it was actually easier than that for them to do. From what I recall they actually have their own in house language that compiles to java. I can't remember what it was called off of the top of my head, but I would imagine it would be much easier to port a compiler than a codebase the size of runescape's.
The content, e.g. quests, map, npcs, dialog, etc are all in proprietary formats (Runescript and various config formats) but this doesn't compile to Java - it's simply loaded by the engine.
The engine, server and client, is 100% hand coded in Java, and the client portion of that is what we manually 'ported' to Javascript. I say 'ported' in quotes, as though lots of the new code performs the same or similar job to the existing Java client (bugs and all!), its implementation is sometimes quite different to that of the original Java version.