Given the set of Java source code files, how can I compile them into one or more JavaScript files that can be used with hand-held JavaScript tools?
Direct correlation between the built-in Java API and the Java language features, as well as JavaScript. Therefore, any attempt to create a "converter" will be incomplete. As a fundamental example, Java classes do not have a direct JavaScript idiom.
Regardless of whether the incomplete conversion tool works for your use case, it is impossible to find out without source code.
However, my suggestion to solve your problem would be to first try using GWT : create a demo project, source your library and call it from the JavaScript side and see what GWT outputs to it .js file. Some of the other tools offered by other posters here are also worth checking out.
If it is fruitful and makes you part of the way, great.
From there, you will need / want to complete the rest of the conversion manually. After all, if you want the code to actually function correctly, a manual check will definitely be fine. Some unit tests that would be converted with it would also be ideal.
You do not indicate how large the source of your project is, but if it is small (even less than a thousand lines of code), even a complete manual conversion should not be extremely complicated. If this were much more, I would suggest considering whether you really want this as JavaScript code.
Brad Peabody Oct 05 '13 at 9:12
source share