# Unable to access jar. Why?

I was making a game in java and exported it as jar file. Then after that, I opeed jar splice. I added the libaries and exported jar. I added the natives then i made a main class. I created a fat jar and put it on my desktop. I'm using Mac OS X 10.8 Mountain Lion. When I put in the terminal, java -jar System Front.jar it says unable to access System Front.jar Even if i double click on the file, it doesen't show up! Help! I'm using slick.

I added slick and lwjgl as libraries for the jar splice at the jars.

I'm afraid I don't know the specifics about "jar splice", but since its likely the problem is highly localized Ill give some general tips for how to troubleshoot this.

Jar files use Zip compression, try opening the file in a zip extractor, if that fails then its no longer in the correct format. If it works however, run a CRC check on the jar file, and look to see that the structure seems correct.

Most likely the jar file is now incorrect and you need to go back to your original jar file, and step by step redo the process, rereading the documentation for the steps to make sure you didn't misread something the first time around.

If the jar file is correct however, then make sure there isn't a simple misspelling issue, perhaps you altered the name from "System Front.jar" to "Systme Front.jar" and since you already know what its called your reading the name too fast and fail to spot the spelling mistake. But a command line would simply fail at this simple mistake.

Also check that your working directory is correct by opening a command prompt and listing the files to make sure your in the correct directory.

Bottom line is, if it should be working but isn't. Then its most likely something wrong that you think is correct. And the simpler it is to get it right, the less likely you are to actually look carefully at if it is right.

When using

java -jar


you need to give the full qualified name of the class you want to execute. That is, if you want to run class a.b.c.System you have to type:

java -jar a.b.c.System Front.jar


Also, you may have to specify the class path using the -cp parameter, a "-cp ." might help. If you want to make an executable jar, you need to include a Manifest file in said jar. It needs to have a property like "mainClass" or so. I can't remember it right now, as I always let my build system create a Manifest vor me ;)

Also I'm a bit confused with your build order: You create your game, export it, add external libraries to it and then you create your main class? Doesn't your game have a main class?