Re: Finding the path that my Application is running in
Re: Finding the path that my Application is running in
- Subject: Re: Finding the path that my Application is running in
- From: Andrew Pinski <email@hidden>
- Date: Mon, 4 Feb 2002 08:35:11 -0500
Because the current directory when you launch the App from the Finder
is "/".
Thanks,
Andrew Pinski
On Monday, February 4, 2002, at 08:18 , Jake MacMullin wrote:
Hi,
I've been writing a simple text editor in Java using the Cocoa API's as
a way of learning Cocoa. Among other things this editor allows me to
compile and run java files that I'm editing. However, I do this by
calling Java's Runtime.exec() method (similar to Cocoa's NSTask), and
passing it the command "javac filename.java -d ." (compile the file
called filename and put the resulting class file in the current
directory), followed by "java classname" (run the resulting class file
in the current directory).
This works really well when I build the application in Project Builder
and run it from my project/build directory. The application puts any
created .class files in the same directory that it is in, and when I
call run they launch ok.
However, as soon as I move my built application (say to the
Applications Directory), something goes wrong. Instead of placing the
.class files in the same directory as the Application, my app puts them
at the root level of my hard drive. I can't think why this might be
happening. As a solution I was wondering if anyone knows of an easy way
to find out (at runtime) where my application is running?
Thanks,
Jake MacMullin
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.