I'm looking for a standard Java to Java bytecode compiler implemented in JavaScript.

Has anyone heard of anything that can accomplish this?

share|improve this question

10  
+1 for insane idea :-). Care to explain... why? – Tomasz Nurkiewicz Feb 17 at 22:26
Haha thanks. For part of my dissertation I would like users to be to write Java code within a web browser. It would support my thesis if the code could be compiled within the browser also. – Jivings Feb 17 at 22:30
2  
It could be worse. He could have asked for a JVM implemented in JavaScript. – DNA Feb 17 at 22:31
1  
I have one written in Logo ;) – Peter Lawrey Feb 17 at 22:40
1  
Aha, another candidate to illustrate the Atwood's Law ? +1 ;o) – Seki Feb 20 at 10:33
show 10 more comments
feedback

4 Answers

up vote 0 down vote accepted

Assuming the existence of working JVM implemented in Javascript, you could get all meta and run this project (a Java compiler written in Java).

share|improve this answer
Yes, and then run jMSX and create a JVM for Z80. Funny comment even though a bit obvious, but not an answer. – owlstead Feb 19 at 16:06
@owlstead Not really an answer to this question. But it is a solution to my problem. – Jivings Feb 19 at 19:08
I saw this on HN today: news.ycombinator.com/item?id=4609406 It's a JVM and supposedly also a java compiler. badassjs.com/post/32812527381/… – ReyCharles Oct 4 at 19:54
feedback

There are several here: https://github.com/jashkenas/coffee-script/wiki/List-of-languages-that-compile-to-JS

Such as j2js, bicavm, doppio...(see the java section)

share|improve this answer
feedback

Maybe something like this?

[ https://github.com/downloads/Jivings/jsJVM ]

It lets Java happen within a browser and is written in JavaScript.

(Technically, CoffeeScript...)

share|improve this answer
Haha seriously? Check the username, that's my project. – Jivings May 7 at 16:30
feedback

if your goal is to have users write Java in a browser and see it run, it makes.MUCH more sense to do the compiling and executing server side. A servlet could read the code, compile it and run it, then push the output back to the browser.

unless your thesis is "Anything that can be written in JavaScript will eventually be written in JavaScript."

share|improve this answer
I think that's his thesis. – gsteff Feb 19 at 21:26
That's an awesome title ;) – Jivings Feb 20 at 10:53
feedback

Your Answer

 
or
required, but never shown
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.