Niklas Rosencrantz
Niklas Rosencrantz

Reputation: 26647

The system cannot find the specified file

Caused by: java.io.FileNotFoundException: town.zip (The system cannot find the f
ile specified)

When I try to load my 3d scene on Windows 7 from a JAR that was built on Linux and vice versa Linux gets the same error as the JAR was packages on Windows. I use just the normal settings for creating a runnable jar in eclipse. What am I doing wrong? This seems to have little or nothing to do with my actual code and is just a packing question.

The code that is loading the file, which works on the same platform on which it is built, is:

assetManager.registerLocator("town.zip", ZipLocator.class);

and this works when the project is run from eclipse or on the same platform as which it is built.

Upvotes: 0

Views: 1143

Answers (1)

Strelok
Strelok

Reputation: 51441

You didn't specify what frameworks you're using, but a quick Google search pointed that you're using the jmonkeyengine, it looks like the ZipLocator actually loads the files using new File(...), so your town.zip should actually sit alongside your JAR file and not packaged inside it.

Upvotes: 2

Related Questions