I want to access my current working directory using java.
My code :
String current = new java.io.File( \".\" ).getCanonicalPath();
System.ou
Current working directory is defined differently in different Java implementations. For certain version prior to Java 7 there was no consistent way to get the working directory. You could work around this by launching Java file with -D
and defining a variable to hold the info
Something like
java -D com.mycompany.workingDir="%0"
That's not quite right, but you get the idea. Then System.getProperty("com.mycompany.workingDir")
...