I am trying to get current directory of my Project from java. I am using the following lines of codes to get the path details.
Type 1:
File directory
There are different context we are talking about here. 1. Running the application in standalone mode. 2. Running the application in container on server side. In #1, The application is run from the directory it is invoked.
But #2 case, the application is run relative to the container, so you see the location of server directory. This also shields the application code.