Search code examples
filepathintellij-ideaworkspace

how to get Intellij Workspace Location URI


What method returns the URI location of workspace. for Ex if the workspace is C:\Intellij\Workspace. i need the path C:\Intellij\Workspace.

In eclipse i can do somthing like this:

File getWorkspaceRoot() {
    return ResourcesPlugin.getWorkspace().getRoot().getRawLocation().makeAbsolute().toFile();
}

How can i do it in Intellij?


Solution

  • IntelliJ doesn't have the concept of a workspace like Eclipse. You work with projects. You start a new project and the name of the project is given in the project panel on the left. Between brackets you find the location of the project on your disk. Once you want to start or open a new project you are asked to replace the current project with the new one or to start it in a new window.

    More info can be found here: IntelliJ documentation - project

    enter image description here