Skip to main content

On Sale: GamesAssetsToolsTabletopComics
Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines
(+1)

What William said. Also it would need to be an applet, derived from a specific class in the Java standard library. Applets don't start from the main method like ordinary Java code.

Thanks for the help. So if I make it as a downloadable file, will people be able to run it without having downloaded Java before? I want to make it so that other people would not have to install/download anything else on the computer, they would just have to open the app and be able to run it.

(+2)

No, for that you'd have to package it with a Java runtime. There used to be utilities for that. But most computers already have Java installed, or else people know what that means and what to do.

Oh ok, then is it possible to convert the java project to an HTML file. I tried converting it to a zip file and submitting it on itch to be playable on the browser but it said it needs an index.html file. Do you know how to create this file?

(+1)

With... a text editor?! Look up a HTML tutorial, e.g. on MDN. But you need a web page that embeds a Java applet. Which is 1) not the same thing and 2) not necessary, because Itch supports Java applets directly. Did you look in the list of project kinds when creating a new one?

How did you circle back to making an applet anyway? We were just talking about making it downloadable because most browsers don't support Java applets anymore. And you can't get around that with tricks.

Thank you for taking your time to help me. I was hoping to use itch.io so that people who don't have Java can play my game very easily. I don't want to ask them to download Java so they can run .jar files. I also tried making it an .exe file but I kept getting messages saying that "this program may have a virus" and I do not want anyone to experience that just for trying to play my game. That is why I think that a Java applet is the best thing for me.

So do you know how to take a regular Java program using graphics, and turn that into a Java applet so that it can be uploaded to itch.io? I understand that applets are deprecated because most browsers don't support them anymore, but is there still a way to make them from a Java IDE such as Eclipse?

(+1)

Once again, you don't have to ask players to download Java because most likely they have it installed already. And to be sure, you can use a utility to bundle the Java runtime with your game. Just search for one online. Spurious warnings from antivirus software are common, many developers run into that problem. And Java applets were deprecated precisely because they were terribly insecure.

No, I don't use Eclipse, but I did make a Java applet long ago, and it has to be made as an applet, which inherits from a specific class in the standard library, and draws on a canvas in the way of output. Eclipse being a big serious Java IDE probably has a project template for that kind of thing. Look for it, and/or check the Eclipse documentation.