This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes Print out the working directory? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Print out the working directory?" Watch "Print out the working directory?" New topic

Print out the working directory?

Lin Shen
Ranch Hand

Joined: Oct 08, 2003
Posts: 57
Hello, I want to know if there is any java library class has a method such that it can return a String, which contains the program's currnt working directory.
Thanks very much
Wayne L Johnson
Ranch Hand

Joined: Sep 03, 2003
Posts: 399
Look at the java.lang.System class API. Under the "getProperties()" method you will see many of the standard Java properties that are set for you. In particular, you may get what you need with the "user.dir", "user.home" or "" properties.
[ January 07, 2004: Message edited by: Wayne L Johnson ]
I agree. Here's the link:
subject: Print out the working directory?
Similar Threads
noclassDefFoundError on maven
Servlet not running
Installing Java problem on nt server
Changing the working directory
Exception oin thread "main"