wattostudios / GameExtractor

Reads and writes thousands of different archive and image formats used in games.
http://www.watto.org
GNU General Public License v2.0
128 stars 9 forks source link

allow invoking the main jar from a different CWD #6

Closed eadmaster closed 3 years ago

eadmaster commented 3 years ago

In order to open some files you need to cd to their dir, as the openFile.bat script suggests. However when invoked this way GameExtractor fail to start because it cannot find the settings subdir:

ERROR: java.io.FileNotFoundException: The settings file /home/andy/.doomsday/runtime/data/jdoom/settings/default.xml does not exist
java.io.FileNotFoundException: The settings file /home/andy/.doomsday/runtime/data/jdoom/settings/default.xml does not exist
        at org.watto.Settings.loadSettings(Settings.java:246)
        at org.watto.Settings.<init>(Settings.java:495)
        at org.watto.WSProgram.buildProgram(WSProgram.java:80)
        at org.watto.WSProgram.<init>(WSProgram.java:61)
        at org.watto.ge.GameExtractor.<init>(GameExtractor.java:497)
        at org.watto.ge.GameExtractor.<clinit>(GameExtractor.java:356)
ERROR: java.io.FileNotFoundException: The settings file /home/andy/.doomsday/runtime/data/jdoom/settings/settings.xml does not exist
java.io.FileNotFoundException: The settings file /home/andy/.doomsday/runtime/data/jdoom/settings/settings.xml does not exist
        at org.watto.Settings.loadSettings(Settings.java:246)
        at org.watto.Settings.<init>(Settings.java:496)
        at org.watto.WSProgram.buildProgram(WSProgram.java:80)
        at org.watto.WSProgram.<init>(WSProgram.java:61)
        at org.watto.ge.GameExtractor.<init>(GameExtractor.java:497)
        at org.watto.ge.GameExtractor.<clinit>(GameExtractor.java:356)
Exception in thread "main" java.lang.ExceptionInInitializerError
Caused by: java.lang.NullPointerException
        at org.watto.Language.loadDirectory(Language.java:151)
        at org.watto.Language.<init>(Language.java:237)
        at org.watto.WSProgram.buildProgram(WSProgram.java:81)
        at org.watto.WSProgram.<init>(WSProgram.java:61)
        at org.watto.ge.GameExtractor.<init>(GameExtractor.java:497)
        at org.watto.ge.GameExtractor.<clinit>(GameExtractor.java:356)
wattostudios commented 3 years ago

I'm going to close this issue - if the file you're trying to open is in a different directory, the syntax should be java -Xmx1024m -jar GameExtractor.jar "" . The openFile.bat script isn't currently used, and is an artifact from a much earlier release of Game Extractor, and in its current form is unlikely to work correctly.