• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Finding the path that my Application is running in
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Finding the path that my Application is running in


  • Subject: Re: Finding the path that my Application is running in
  • From: John Timmer <email@hidden>
  • Date: Mon, 04 Feb 2002 13:09:54 -0500

Since you're using Cocoa anyway, have you thought of:

PathString = NSBundle.mainBundle().bundlePath();



Jay


> 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?


References: 
 >Finding the path that my Application is running in (From: Jake MacMullin <email@hidden>)

  • Prev by Date: Re: Modification dates and AFP
  • Next by Date: Re: Speed of Quartz (was: optimizing compilers)
  • Previous by thread: Re: Finding the path that my Application is running in
  • Next by thread: Re: Speed of Quartz (was: optimizing compilers)
  • Index(es):
    • Date
    • Thread