Running two IDEA instances with my plugin Follow
Hi,
I would like to run two instances of my plugin, because the plugin communicates between two IDEA instances. It works when I
- create duplicate intelliJ installations with seperate ~/.ideaIC* folders
- duplicate code folders for each
This is OK, but it is annoying because I have to sync the two source folders manually.
So I tried to run two instances from one IntelliJ application and managed to start them by changing the "Project structure -> SDK -> Sandbox home" setting between starts. I am able to start the plugin in one instance, but as soon as I want to start it in the other, I get ClassLoaderExceptions:
ERROR 17:37:49,729 [AWT-EventQueue-0 13.1.2#IC-135.690, eap:false] (IdeaLogger.java:141) de/fu_berlin/inf/dpp/intellij/ui/util/SafeDialogUtils
java.lang.NoClassDefFoundError: de/fu_berlin/inf/dpp/intellij/ui/util/SafeDialogUtils
at de.fu_berlin.inf.dpp.intellij.ui.actions.ConnectServerAction.run(ConnectServerAction.java:125)
at de.fu_berlin.inf.dpp.intellij.ui.actions.core.SarosActionFactory.startAction(SarosActionFactory.java:97)
(...)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:91)
Caused by: java.lang.ClassNotFoundException: de.fu_berlin.inf.dpp.intellij.ui.util.SafeDialogUtils PluginClassLoader[de.fu_berlin.inf.dpp.intellij.1, 10.1.1]
at com.intellij.ide.plugins.cl.PluginClassLoader.loadClass(PluginClassLoader.java:68)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
... 46 more
Is there any way to start two IntellIJ plugin instances from one IntelliJ instance? Or should I stick to the duplication above?
Regards,
Holger
Please sign in to leave a comment.
Try to create a second project where you import a module from the original project, and make a new IJ SDK with a different sandbox folder.
That seems to work, thank you very much! (With two instances started from two different IDEA instances, but one source folder)
You should be able to start two instances from two different projects (from one IDEA instance).
I have some difficulty with the IDEA terminology now, I always thought only 1 project could be open in 1 instance. What do you mean by one IDEA instance?
* One IDEA windows with two projects
* Two IDEA windows with one project each, started from the same IDEA installation
* Two IDEA instances, started from two different installations
One IDEA window can contain only one project.
One instance can open multiple projects/windows.
To open a second instance, you need a different installation directory and different .IntelliJIdeaXX folder.
When I do that I always get a
Howver starting two instances (from two installations) probably is OK for testing.
It works totally fine for me... https://www.dropbox.com/s/yliutdp0xd56rf5/2instances.mp4
Thank you very much for the video. This way one source directory is shared.
(in case the video is put offline, he creates a new projects, import the module by importing the .iml and creates a new project SDK in the new project, pointing to a different sandbox)
Howeber, when I do as you do, (importing the module so that they share one .iml), changing the Project SDK in one module always changes it in the other module too! Doesn't that happen to you too?
I could only fix it by starting two instances again (from two different directories) :S
No, the module should have "Project SDK" set, if you are setting a specific SDK to the module and not to the project, then it won't work.
I had that -- the module has project SDK set. But when I change the project SDK in one instance, it is also changed in the other. This was not the case in your setup, right?
Right. For example when I change the project SDK to plain Java SDK so that it cannot be compiled, then the other project is totally fine.
If you look into the .iml file, there should be:
Well who knows what happened there, I tried it again and it worked perfectly. For the sake of posterity, in case the video is taken down again (thanks again for creating that, it was really helpful!).
This way the module settings can stay the same across both projects (Module SDK is project SDK, all libraries have the same name) and only the project settings, that reside in the new project's folder are changed.