This week's book giveaway is in the Big Data forum.
We're giving away four copies of Elasticsearch in Action and have Radu Gheorghe & Matthew Lee Hinman on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes Getting the users directory path Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Elasticsearch in Action this week in the Big Data forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Getting the users directory path" Watch "Getting the users directory path" New topic
Author

Getting the users directory path

cardwell cupp
Ranch Hand

Joined: Aug 16, 2001
Posts: 66
Is it possible to get the directory that the java file is being run from? I am writing some code that has to do with icons(it is not an applet), I don't want to have to hard code the paths.
Thanks all for the help
Cardwell
Marilyn de Queiroz
Sheriff

Joined: Jul 22, 2000
Posts: 9055
    
  12
Check out the methods in the java.io.File class


JavaBeginnersFaq
"Yesterday is history, tomorrow is a mystery, and today is a gift; that's why they call it the present." Eleanor Roosevelt
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Getting the users directory path