6

So as far as I'm aware, JetBrains mostly uses Java (swing) for their IDE's.

But I noticed all their IDE's have a .exe, so I was wondering, where/how does their JDK gets executed. Especially since the JDK is not even showing up in the task manager.

I tried myself to create a exe and start the JDK as subprocess but even then the task manger does show the JDK running as separate app.

How are they doing it did they modify the JDK to achieve this?

LazyOne
  • 158,824
  • 45
  • 388
  • 391
natschz
  • 1,007
  • 10
  • 23
  • If you ask this question in Jetbrain forum, probably they may answer, by the way what do you want to do? Do you want to achieve something like this ? – Sambit May 21 '19 at 17:26
  • I'm working on a JavaFX application and yea I want to achieve the same. No IDE but I wan't to have a exe have it show up right in the taskmanager and yea maybe there are some other things I didn't even consider yet. – natschz May 21 '19 at 17:38
  • Not sure what JetBrains does, but you can use [`jpackage`](https://jdk.java.net/jpackage/) (currently early-access). – Slaw May 21 '19 at 17:44
  • I suspect they have a native executable written in C which dynamically links to jvm.dll. This is explained in [this answer](https://stackoverflow.com/questions/8503327/difference-between-java-exe-javaw-exe-and-jvm-dll/8503524). – ZhekaKozlov May 21 '19 at 18:08
  • Let us [continue this discussion in chat](https://chat.stackoverflow.com/rooms/193723/discussion-between-slaw-and-natschz). – Slaw May 21 '19 at 19:53

1 Answers1

10

JetBrains IntelliJ IDEA based products use the custom launcher to load the JVM on Windows. It's open source and you can investigate how it works by analyzing the WinLauncher source code in the GitHub repository. It loads jvm.dll dynamically.

Many years ago we used a third-party solution (EXE4J), but switched to the custom launcher for more flexibility and to make IntelliJ IDEA Community 100% open source.

CrazyCoder
  • 389,263
  • 172
  • 990
  • 904
  • Direct Link to source file: https://github.com/JetBrains/intellij-community/blob/980129c6eaf755043574d138869c7a28dd935922/native/WinLauncher/WinLauncher.cpp – user3789797 Feb 05 '23 at 12:01