Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

JavaWizKid

macrumors 6502a
Original poster
Sep 18, 2008
572
1
How can I do this?

#!/bin/bash
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!
#!/bin/bash
java -jar -Djava.library.path="$_/../"lib "$_/../"CastleWars.jar
 
Last edited:
How can I do this?

#!/bin/bash
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!
#!/bin/bash
java -jar -Djava.library.path="$_/../"lib "$_/../"CastleWars.jar

Shouldn't it be?:
Code:
java  -Djava.library.path=lib  -jar CastleWars.jar
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.