0


In my project I need to take Java code and compile it to a Javascript library so it may be used in my web application.
I'm thinking of using GWT, but I don't need all that it offers. I just need a simple command line utility that can take Java code and emit Javascript.
I haven't used GWT before and I'm getting a little lost in all of the information out there about building a complete web application.
The GWT Exporter project seems interesting, but I can't figure out how to use in my use case.
Any help is appreciated

2
  • A "complete" GWT web application may consist of a single entry point class which compiles into a single JavaScript file. So, what's the problem? Commented Dec 1, 2014 at 14:39
  • The problem is that I'm not a GWT expert and it seems too complicated for my use case. A simple command line utility that works like: "compile-java-to-js JavaFile.java" would be ideal for me. Commented Dec 4, 2014 at 11:00

1 Answer 1

1

ST-JS may be what you're looking for. In a nutshell, it's a way to compile a subset of Java into JavaScript so your Java and JavaScript code use the same API. The Java side of the tool even emulates jQuery (so you can use $(...) in Java code with code completion and type safety).

This code can't be executed in the Java VM. It's mainly a type safe way to write JavaScript code.

You can find more details in my blog post: http://blog.pdark.de/2013/10/24/jazoon-2013-stjs-managing-javascript-application-complexity/

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.