How to locate the Path of the current project directory in Java (IDE)?

前端 未结 9 1384
梦如初夏
梦如初夏 2020-11-28 21:46

I am trying to locate the path of the current running/debugged project programmatically in Java, I looked in Google and what I found was System.getProperty(\"user.id\"

9条回答
  •  粉色の甜心
    2020-11-28 22:23

    you can get the current project path use System.getProperty("user.dir")

    in that method you write Key name to get your different-different paths, and if you don't know key, you can find all property use of System.getProperties() this method is return all property with key. and you can find key name manually from it.

    and write System.getProperty("KEY NAME")

    and get your require path.

提交回复
热议问题