Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

How to handle .command launch directory?



Hi, all.

I have a .sh file that launches one of my programs. I do not know what directory the jar will be in, save that the .sh file will be in the same place. The current .sh file reads:

java -Xms128MB -Xmx512MB -jar test.jar -propfile=test.properties

and works just fine when launched from the directory it, test.jar, and test.properties are in.

I just turned it into a .command file, and while it still works from the working directory, double clicking it launches it from somewhere else, causing it to fail.

Any suggestions on how I can find the directory of the .command file launched, so I can find my jar?

I cannot use a plain jar with manifest, as I need to send the options in, and building an executable bundle for it would work, but will be a bit of a pain given that the jar is generated by the nightly build on our linux boxes.

Installers are not really an option for many reasons.

Suggestions?

Scott
_______________________________________________
java-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/java-dev
Be sure to read the FAQ http://developer.apple.com/java/faq/ before posting
Do not post admin requests to the list. They will be ignored.



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.