Running jar file via .command file

Discussion in 'Mac Programming' started by JavaWizKid, Jul 24, 2011.

  1. JavaWizKid, Jul 24, 2011
    Last edited: Jul 24, 2011

    JavaWizKid macrumors 6502a

    Sep 18, 2008
    How can I do this?

    java -jar -Djava.library.path=lib CastleWars.jar

    It errors with unable to access CastleWars.jar

    How can I get unix to recognise where the .command file is being launched from and then put that path in front of CastleWars.jar?

    GOT IT!
    java -jar -Djava.library.path="$_/../"lib "$_/../"CastleWars.jar
  2. mrbash macrumors 6502

    Aug 10, 2008
    Shouldn't it be?:
    java  -Djava.library.path=lib  -jar CastleWars.jar

Share This Page