what exactly does "-cp" mean?
The -cp flag is short for -classpath, which tells the java command where to look for the class files. If you didn't put *.jar file in the classpath, then Java would not be able to find the code.
The source files do not have anything to do with the jar file working. A jar file is just a *.zip file renamed to *.jar. You could create the jar file as a zip file by hand, including the source code, and then change the extension to *.jar.
However, most people, for creating jar files like this, either do it from the command line or use
http://ant.apache.org/Something looks weird with your class files. They need to be in the package folders in the jar, and you shouldn't be using classes without at least one package. In the past, I have had trouble getting code without any packages to work like this. It seems like something is wrong, because I see your game is called Game, but I also see a Game folder in the jar screenshot.
One thing, is that the main class needs the fully qualified java name. For example, a typical manifest for my games looks like this:
Main-Class: tim.game.app.ReallyAwesomeGame
// ReallyAwesomeGame.java
package tim.game.app; // VERY IMPORTANT!!!
When compiled there with be a folder for each package level, and the Really AwesomeGame file must be in the package structure inside the jar file.
tim
- game
- app
ReallyAwesomeGame
If this stuff isn't exactly right, it won't work.
I think, therefore I am. I think? - "George Carlin"