英文:
Is there a way to change "home" directory in Intellij?
问题
我正在使用IntelliJ IDEA,并且对Linux不太熟悉。例如,我有一个项目目录结构如下:
项目文件夹
|---> src
| | |---> MyCodes.java
| | |---> hello.txt
现在,如果我想在MyCodes.java中使用相对路径访问hello.txt,我需要使用"src/hello.txt",其中"home"目录是项目文件夹。然而,如果我将没有src文件夹的文件复制到Linux中,运行将会失败。有没有办法可以将src设置为"home",这样我就可以用相对路径简单地访问"hello.txt",即使在复制到Linux后也不会失败呢?谢谢!
英文:
I'm using intellij Idea, and new to linux
So for example, I have a project directory structure below
ProjectFolder
|--> src
| | |--> MyCodes.java
| | |--> hello.txt
Now, if I want to access hello.txt in MyCodes.java with relative path, I need to use "src/hello.txt", where the "home" directory is the ProjectFolder. However, if I copy my files in src(without src folder) into linux, it would fail to run. Is there a way I can set src as "home", so I can access with relative path simply "hello.txt", and therefore won't fail even after copying to linux?
Thanks!
答案1
得分: 0
可以在运行配置中设置工作目录:
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论