How to retrieve the IdeaProjects path?

Hello everyone,

I'm developing an ApplicationComponent plugin and I want to retrieve the IdeaProjects path. 

I don't have an opened project, so that I could use something like getBaseDir() etc.

How can I achieve that? Is it stored in a variable from which I could directly access it?

Thanks in advance!

0
3 comments

Hello,

IdeaProjects path isn't stored anywhere. By default IDEA suggests to create new projects under USER_HOME/IdeaProjects directory, but if you change that it'll remember your choice and will suggest to create a next project in the specified directory (see the source code for details). So what do you need this path for?

1
Avatar
Permanently deleted user

Hello Nikolay,

thank you for your reply.

I need it in order to create a new project programmatically using the following function

ProjectManager.getInstance().createProject(@Nullable String name, @NotNull String path)
0

It would be better to let user choose where to create the project then (via com.intellij.openapi.fileChooser.FileChooser).

0

Please sign in to leave a comment.