1

I have created a small game using IntelliJ and I'm not sure how to add it to my weebly page I'm making for a project. My game has multiple classes and I have no idea how to get it to be built into the website, or at least redirect you to the game somewhere. Im very new to java and website building so any help would be greatly appreciated.

I don't really know where to start, I have looked up some online solutions but have not been successful.

user2121
  • 11
  • 2
  • In short: you can't. The only way to integrate a java app into websites was a thing called "Applets" which were deprecated in 2017 and by now not supported anymore by likely all browsers. There's a thing called JNLP which lets you start executable java files via the web, but it's not embedded into a website. – f1sh Jan 24 '23 at 09:55
  • Would I be able to link my webpage to JNLP so the person viewing the website could be redirected there to play the game? – user2121 Jan 24 '23 at 09:58
  • @user2121 it would be a lot easier if you let the player download the game and run it on their machine. By the way, there are frameworks that let you write a game in java and deploy it on a web page (like libGDX), but you'll have to rewrite your game to use that library. – Federico klez Culloca Jan 24 '23 at 10:00
  • If the player had to download the game would they need an application like IntelliJ to run it? – user2121 Jan 24 '23 at 10:03
  • @user2121 no, just a Java runtime. Which you can embed yourself with the download, by the way (just don't embed the Oracle one, because licensing). – Federico klez Culloca Jan 24 '23 at 10:04
  • Do you mean I embed the java runtime download with the game so the player has to download both? Thank you for the replies by the way I appreciate it. – user2121 Jan 24 '23 at 10:06
  • @user2121 exactly. Basically you create a zip that contains the jar you created for your project, any library you depend on and the java runtime. [Here](https://stackoverflow.com/a/62461826/133203) is a longer explanation on how you can do it with links to relevant instructions. – Federico klez Culloca Jan 24 '23 at 10:09

0 Answers0