Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is a working directory in Intellij IDEA

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 this folder it doesn't seem to affect anything. So what is it?

like image 930
user1745356 Avatar asked Nov 07 '13 14:11

user1745356


People also ask

What is meant by working directory?

In computing, the working directory of a process is a directory of a hierarchical file system, if any, dynamically associated with each process. It is sometimes called the current working directory (CWD), e.g. the BSD getcwd function, or just current directory.

What is difference between module and directory IntelliJ?

a module is like a project, it produce jar file and can behave independently, but directory is part of a project and use to organize folders and classes.

How do I change directory in IntelliJ?

Change the default location for projects In the Settings/Preferences dialog ( Ctrl+Alt+S ), select Appearance & Behavior | System Settings. In the Default project directory field, specify the path to the folder in which you want to store your projects. Apply the changes and close the dialog.

What is source directory in IntelliJ?

Content in IntelliJ IDEA is a group of files that contain your source code, build scripts, tests, and documentation. These files are usually organized in a hierarchy. The top-level folder is called a content root. Modules normally have one content root. You can add more content roots.


1 Answers

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.

like image 81
Javaru Avatar answered Oct 10 '22 19:10

Javaru