06 March 2017
Printing current path
When coding in Java I found myself having to print the current path of the executing JVM program in order to troubleshoot File not Found exceptions and other file-system related issues.
There are different ways to do that in Java:
1. Using System properties
You can use System class getting the user.dir property to achieve this:
2. using NIO Path
In Java 7 and beyond you can use NIO Path to get current path: