PDA

View Full Version : .jar?



Mikeumus
01-13-2009, 10:49 PM
There is an open source java game at http://www.mojang.com/notch/j4k/l4kd/

He gives the source code for the game at this page:

http://www.mojang.com/notch/j4k/l4kd/G.java

How do I turn a .java file into a .jar file?

And how would I take this source code and add a multiplayer element to it?

Twey
01-14-2009, 06:08 AM
By first compiling it, then zipping it up into a JAR (a .jar file is just a .zip file with a specific directory structure and some added metadata). JARs are typically created using the jar tool: simply jar -cf G.jar G.class.
And how would I take this source code and add a multiplayer element to it?Uhm... well, you'd have to write more source :) Perhaps a Java tutorial (http://java.sun.com/docs/books/tutorial/) is what you really want?