I've done some searching around both on this site and Google but haven't been able to find any information. I have a Java application that launches .app files in Mac OS. Now I understand that the .app extension is not really an executable but rather an application bundle which contains the executable in the "/Contents/MacOS/" sub directory.
For my example I'll use the app "/Applications/Chess.app". So in this case, the actual executable is located in "/Applications/Chess.app/Contents/MacOS/"
Is it simply just a matter of setting the working directory to be "/Applications/Chess.app/Contents/MacOS/"?
Mac apps generally can't rely on the working directory being set to anything in particular. Xcode sets it one way, launching from the Finder sets it a different way (usually to /).
However, you shouldn't run an app by just executing the binary in Contents/MacOS. You should use Launch Services or NSWorkspace (or, failing either of those, /usr/bin/open) to launch them.
I use "$APP_PACKAGE/Contents/..." [value] under the "WorkingDirectory" [key] set in string mode under [dictionary] "Java". Hope this helps.
I'm trying to change the location by user so I've been there the only problem is that the size of your app will increase exponentially but never decrease even if you delete all the contents so I'm trying to work out side of it tell me how it goes. Luck to you.
Desktop.getDesktop().open("/Applications/Chess.app")
a_horse_with_no_name 2012-04-04 17:35