What is a working directory in Intellij IDEA

后端 未结 3 1957
小蘑菇
小蘑菇 2020-12-30 05:08

I created a maven project and imported it in intellij. In a run configuration there is a field \"working directory\" which points to the root of maven project. If I change t

相关标签:
3条回答
  • 2020-12-30 05:42

    This is the directory that is set as the Java user.dir system property. If you have any code that creates relative files or directories, it will be relative to this directory. So for a well designed application (i.e. resolves resources from the classpath and is configurable for output directories) this will not be a factor. There is also some importance to this value in maven projects, especially multi-module maven projects. This directory specifies the directory IDEA will read the POM from.

    If you are unflamilar with what the Java user.dir is, there is some discussion available here and in the class level Javadoc for the File class.

    0 讨论(0)
  • 2020-12-30 05:57

    In addition to answer given by @Javaru if you want to update or view your working directory in IntelliJ IDEA go to:
    Edit Configuration | Configuration Tab | Working Directory

    0 讨论(0)
  • 2020-12-30 05:57

    From the IntellJ help Run/Debug Configuration: Maven

    Working directory Specify the path to the Maven project file pom.xml.

    0 讨论(0)
提交回复
热议问题