I'm trying to build an online java editor. I need the functionality that enables me to report the compilation errors to the user on clicking submit if there are any. I'm curious to know if there are any javascript libraries out there that I could use off the shelf to do this.
-
You really want to build a JVM in javascript?Bergi– Bergi2012-07-05 20:48:32 +00:00Commented Jul 5, 2012 at 20:48
-
Well not a JVM but a Java compiler.Harshal Pandya– Harshal Pandya2012-07-05 20:53:41 +00:00Commented Jul 5, 2012 at 20:53
-
Yeah, I think there's no big difference - after having it "compiled", there is not much work to execute it (unless you really create binaries)Bergi– Bergi2012-07-05 20:56:57 +00:00Commented Jul 5, 2012 at 20:56
-
@HarshalPandya - did you ever find a compiler in JS?Dingredient– Dingredient2015-12-04 03:19:51 +00:00Commented Dec 4, 2015 at 3:19
Add a comment
|
1 Answer
Take the text and call javac on it on the server side, send back the results in some structured way and display on the client side
1 Comment
Harshal Pandya
That is exactly how I have implemented it at the moment. I just wanted to know if there was anyway I could save the calls to the server. As in make the call only if the code is free of compilation errors.