How to find current working directory?
SolutionFollowing example shows how to get current directory using getProperty() method.
public class Main { public static void main(String[] args) { String curDir = System.getProperty("user.dir"); System.out.println("You currently working in :" + curDir+ ": Directory"); } }Result
The above code sample will produce the following result.
You currently working in :C:\Documents and Settings\user\ My Documents\NetBeansProjects\TestApp: Directory
java_directories.htm
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4