Unless you also have the source code (either in the JAR, or separately), then the best you can do is to use a Java decompiler. Depending on how the code was compiled in the first place, this might generate source code which is significantly different to what the original author wrote (although functionally identical, of course). For example, certain optimizer options could result in loops being re-written and local variables being removed. Certain debug options could result in the names of local variables being removed, so the decompiler will have to invent (meaningless) names for them, etc.
I would also question whether what you want to do is legal. Generally, if a project is licensed for modification then its source code will be available and you won't need to do what you're proposing.
Answer from dty on Stack OverflowJava Decompiler in MyEclipse - Genuitec
Eclipse: How Do I decompile jar and load it as a project? - Stack Overflow
Looking for a Java decompiler
Java decompiler, open jar excecutable file in eclipse and see source code - Stack Overflow
Videos
Unless you also have the source code (either in the JAR, or separately), then the best you can do is to use a Java decompiler. Depending on how the code was compiled in the first place, this might generate source code which is significantly different to what the original author wrote (although functionally identical, of course). For example, certain optimizer options could result in loops being re-written and local variables being removed. Certain debug options could result in the names of local variables being removed, so the decompiler will have to invent (meaningless) names for them, etc.
I would also question whether what you want to do is legal. Generally, if a project is licensed for modification then its source code will be available and you won't need to do what you're proposing.
I've used the Cavaj decompiler and it worked pretty well for me. You can just open up the jar file with any unzipping program like 7zip, .jar files are really just zip files. Then all you need to do is feed the .class files to Cavaj. The .class files are organized by package, so com.foo.Bar will be com/foo/Bar.class inside the .jar
Like Danny said, legality might be questionable depending on the situation. I've only ever used it to look at the source for an older version of an application I wrote but no longer had the source for.
I have a couple of .jar games on my disk. I want to decompile the bytecode back to the readable .java format.
What are my options? Google wasn't very helpful, throwing old sites at me with broken download links.
I just want to learn - I played the game lots of times so I know what it does, now I want to know how it does it.
EDIT: Thanks to everyone who replied, the post stays so that others can use. I decided to use jd-gui, but it's good to know many Java IDEs have plugins to do this too (I use Netbeans and I couldn't find a decompiler plugin for it)