How to open two projects in the same window
I have always liked having each project in a separate window. But now my job is using an architecture where there are 2 (sometimes 3) projects that make up a single service. When I installed IntelliJ I chose “Open in Separate windows and don't ask me again”.
Now I'd like it to change this to prompt so I can get related projects in one window, but not every one of the dozens of projects.
I have spent about 2 hours reading from every corner of the internet versions of: Settings/Appearance & Behavior/System Settings/Open project in: (New Window / Current Window / Ask).
I did find ONE JetBrains post that correctly states that “Current Window” means replace my existing project with this new one. I cannot explain the literal scores of posts that all say this is what I want. Other than to observe most of them are about Python or PHP. I want to do this in Java. It seems the term I may be looking for is “Attach Window”. Please note I am not asking for Merge Windows (new Mac feature). This seems very cool and I may incorporate it. But it is not what I want right now.
I also spent a LONG time trying to import the supporting projects as modules. But that never gave me a satisfactory configuration. Plus several other people on the team have this working without tons of configuration. Sadly they don't know how.
So short of wiping out all my configurations I have so meticulously set, what is the real setting I need to change to get a prompt to sometimes open a project in the same window?
Please sign in to leave a comment.
Do you use macOS?
Does https://stackoverflow.com/questions/65397429/how-to-open-projects-as-tabs-in-intellij answer your question?
Thanks for the reply. I never would have expected a MacOS setting to be part of the story. Unfortunately it didn't help. But I have figured out that I can get what I wanted a different way.
Rather than OPENing the second project New/Module from Existing Sources is indeed the correct choice. However if you just choose the directory you get dropped into the import dialog flow that I complained about above - and am pretty sure can't be made to work.
BUT if you explicitly select the build.gradle file it does exactly what I had hoped. I would assume selecting a pom.xml file would work as well.
I'd never seen it make a difference before as IntelliJ always finds the build file and figures it all out. But Wow! It so very much does not on New/Module. Anyhow thanks for the help and maybe this will save some other poor soul a couple hours.
Go to file → new → Module from existing source
Then select the folder/project you want top open, then select option as → “Import module from external model” → Gradle → Create
Now 2nd project appears under 1st project. You can import as many projects as required following the same instructions