Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Print out the working directory?

 
Lin Shen
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 399
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 "java.io.tmpdir" properties.
[ January 07, 2004: Message edited by: Wayne L Johnson ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic