0

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

9
  • 1
    What is "normal Java"? Please clarify your question by explaining some of the important background information and details. Feb 18, 2014 at 15:24
  • 1
    Don't do that. You should rewrite it in Javascript.
    – SLaks
    Feb 18, 2014 at 15:25
  • 3
    stackoverflow.com/questions/985754/…
    – Bucket
    Feb 18, 2014 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? Feb 18, 2014 at 15:33
  • 1
    Let's not forget Java Web Start or JNLP. Feb 18, 2014 at 15:33

2 Answers 2

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.

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.

2
  • 2
    Oracle/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, 2014 at 15:31
  • 1
    NO 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, 2014 at 15:38

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