how to get current directory in java?

后端 未结 4 1657
无人共我
无人共我 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条回答
  •  猫巷女王i
    2021-01-13 15:33

    It because when you execute from main class everything is fine, but this code runs on server it looks into current directory and current the directory structure is Apache 'bin' from where you have started the server(run.bat).

提交回复
热议问题