I am invoking the command using a bash shell in linux. This command completes its operation using java class. I want to retrieve the present working directory from where the command is invoked. When I am using System.getProperty("user.dir") I am getting the path from where the java class is invoked. Can anyone help in this.
+1
A:
You will have to pass the directory in from the shell to the JVM on the command line.
Jim Garrison
2009-09-24 18:40:32
+1
A:
new File(".")
You can then call getAbsolutePath or whatever you like.
daveb
2009-09-24 18:50:03
I believe that will assume the same directory as user.dir, which the OP said was not what s/he wanted.
Jim Garrison
2009-09-24 20:07:19