is there any way to put normal java code into a website? i have made a game with DrJava and i would like to put that somehow onto a website, is there a way to do such a thing? like would I have to convert java to javascript or what? this is not an applet and is just written in normal java, and i am no expert in coding. please help
Asked
Active
Viewed 654 times
0
-
1What is "normal Java"? Please clarify your question by explaining some of the important background information and details. – Hovercraft Full Of Eels Feb 18 '14 at 15:24
-
1Don't do that. You should rewrite it in Javascript. – SLaks Feb 18 '14 at 15:25
-
3http://stackoverflow.com/questions/985754/how-to-deploy-a-java-applet-for-todays-browsers-applet-embed-object – Bucket Feb 18 '14 at 15:27
-
So your saying i have to rewrite the whole game in a language i don't even know? guess its time to learn. How different is javascript from regular java? – Megaeverything Feb 18 '14 at 15:33
-
1Let's not forget [Java Web Start](http://docs.oracle.com/javase/tutorial/deployment/webstart/) or JNLP. – Hovercraft Full Of Eels Feb 18 '14 at 15:33
-
if you want your application to be fully functional webapp, have a look at some compilers java to javascript, or try to use gwt – user902383 Feb 18 '14 at 15:42
-
There are too many ways to do something like this to answer this question. Write it as an applet is probably the best approach for you. – Kevin Panko Feb 18 '14 at 15:53
-
@Megaeverything Java and JavaScript have almost nothing in common besides a name. – Boann Feb 18 '14 at 17:05
-
"put on hold as too broad by ... Boann" [No I didn't](https://meta.stackexchange.com/questions/54917/distinguish-votes-to-close-by-reason) – Boann Feb 18 '14 at 17:07
2 Answers
2
You could always run the Java program from an applet. You might need to sign the applet and take care of permissions if you need filesystem or socket access.

Martin Dinov
- 8,757
- 3
- 29
- 41
0
Java has applets. However, like SLaks said Java's not meant for the browser Sun tried early on to make Java the programming language of choice for the web client-side and failed.

mpdunson
- 227
- 1
- 11
-
2Oracle/Sun failed in what way? Java is the server-side code and JSTL is the client. There are a lot of web sites that are built (processing) on Java. Just because it's not embedded in an HTML page (unless you use JSTL, JSP) doesn't make it a failed web language. – Matt Feb 18 '14 at 15:31
-
1NO NO NO NO!!! I wasn't saying it failed server-side. Yes, Java is by far the winner there. However, he's asking to implement his application client-side with Java and that is a recipe for disaster by far! – mpdunson Feb 18 '14 at 15:38