I have an existing IntelliJ Java project on my disk. I try to find a way to load this project into an com.intellij.openapi.project.Project object using some APIs so I can use project object to proceed some work.
I tried the following code:
ProjectManager projectManager = ProjectManager.getInstance();
ProjectManagerEx pm = ProjectManagerEx.getInstanceEx();
Project project = pm.loadProject("some project path...");
It throws exception in ProjectManager.getInstance(); where inside this method throws null pointer exception since there is no application object.
So is this the correct way to do that or is there any other way to get the project object?
Also, I find this blog post https://blog.jetbrains.com/platform/2020/10/new-implementation-of-project-model-interfaces-in-2020-3/ , will "WorkspaceEntityStorage" help to do that? If so, can you please let me know how to do that?