Explanation
I have a project in java & which will be built as a jar after completion. The tree structure of the project is as follows.
/home/software/Documents/ProjectHome
│── res
│** └── ProjectSetupConfiguration.xml
├── com
│** └── peek
│** └── svn
│** ├── SVNModel.class
│** ├── UpdateVersion.class
Here the two classes I build as a jar called "updater.jar" and I copied in /home/software/Documents/ProjectHome
Now the problem comes as..
/home/software/Documents/ProjectHome ]# ll
-rw-rw-r--. 1 software software 12272033 Nov 2 14:55 updater.jar
drwxrwxr-x. 3 software software 4096 Nov 2 13:47 res
/home/software/Documents/ProjectHome ]# java -jar updater.jar
Output
======
It's working fine.
/home/software ]# java -jar updater.jar
canonical : /home/software
absolute : /home/software.
path : .
executionPath : /home/software
executionPath : /home/software
java.io.FileNotFoundException: /home/software/res/ProjectSetupConfiguration.xml (No such file or directory)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(FileInputStream.jav a:138)
at java.io.FileInputStream.<init>(FileInputStream.jav a:97)
I tried:
System.out.println("canonical : "+new File(".").getCanonicalPath().trim().toString());
System.out.println("absolute : "+new File(".").getAbsolutePath().trim().toString());
System.out.println("path : "+new File(".").getPath().trim().toString());
String executionPath = System.getProperty("user.dir");
System.out.println("executionPath : "+executionPath);
and even i tried the command "pwd" and executed using ProcessBuilder().....!!!
Is there any solution for me..