I’m making a game in java, it opens a window, does a few graphics things, and it works from the class files with java Game.
I know that using jar cfm Game.jar src/manifest.txt src/*.class creates the jar perfectly fine, but it won’t run when I double click the jar.
I’ve seen other code before, and I have even made a runnable jar before, but now I can’t find the old one, nor can I find any help (for mac, with the console (NOT ECLISPE)).
Can anyone tell me what I am doing wrong?
Here’s what I have so far:
– Two class files, one with the main method
– The manifest.txt with Main-Class: Game (I put an enter as the last line)
– The command to make a jar via the console
– The output jar that has the files in it, but it won’t run when double clicking
I think I need to put something on the Game class stating that it implements Runnable, or something of the sort.
Any ideas?
I just figured it out on my own. No thanks to the internet, mainly oracle… -.-
I put
implements Runnableright after the Game class, and it worked right away!Thanks for the help, all those tutorials online that leave that small bit out :/
You don’t need to import anything either, just do: