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

前端 未结 9 1382
梦如初夏
梦如初夏 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:17

    What about System.getProperty("user.dir")? It'll give you the working directory from where your program was launched.

    See System Properties from the Java Tutorial for an overview of Java's System Properties.

提交回复
热议问题