how to get current directory in java?

后端 未结 4 1650
无人共我
无人共我 2021-01-13 14:34

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         


        
4条回答
  •  难免孤独
    2021-01-13 15:32

    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.

提交回复
热议问题