什么是Intellij IDEA的工作目录 [英] What is a working directory in Intellij IDEA

查看:686
本文介绍了什么是Intellij IDEA的工作目录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个maven项目并将其导入intellij。在运行配置中,有一个字段工作目录,它指向maven项目的根目录。如果我更改此文件夹,它似乎不会影响任何东西。那是什么?

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?

推荐答案

这是设置为Java的目录 user.dir 系统属性。如果您有任何创建相关文件或目录的代码,它将相对于此目录。因此,对于设计良好的应用程序(即从类路径中解析资源并可为输出目录配置),这不是一个因素。在maven项目中,这个价值也很重要,特别是多模块maven项目。此目录指定IDEA将从中读取POM的目录。

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.

这篇关于什么是Intellij IDEA的工作目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆