How to start an application in background IDEA via plugin

Answered

I'm starting a Java application via plugin, if IDEA is running in background, the following lines:

DumbService dumbService = DumbService.getInstance(project);
dumbService.smartInvokeLater(() -> SofaUtils.startApplication(project, DefaultRunExecutor.getRunExecutorInstance()));

will not be executed after a long waiting, is there any solution to start an application running IntelliJ IDEA in background?

3 comments
Comment actions Permalink

Hello:

I find your question interesting.

Can you give more detail about running in the background.

You mean that IDEA is not the active application and you only need to select it to bring it to the front.

Or if it's on windows it's running on another desktop.

Or idea runs completely in the background using X forwarding

0
Comment actions Permalink

running in background means  idea is started in projector mode(or headerless?) on a linux server, I hope the application can be started by a plugin no matter the projector client is started or not

0
Comment actions Permalink

Please see https://plugins.jetbrains.com/docs/intellij/plugin-components.html#application-startup and following sections on how to automatically invoke code on application/project open.

0

Please sign in to leave a comment.