BT

Facilitating the Spread of Knowledge and Innovation in Professional Software Development

Write for InfoQ

Topics

Choose your language

InfoQ Homepage News JetBrains Releases Projector, a Technology to Remotely Run Swing Applications

JetBrains Releases Projector, a Technology to Remotely Run Swing Applications

This item in japanese

Lire ce contenu en français

JetBrains recently released the first major iteration of Projector, a technology that allows developers to run and operate Swing GUI applications remotely. Resource-hungry applications like Android Studio may run on a powerful server while developers need only a web browser on a thin client.

JetBrains detailed in the release note the rationale behind Projector:

As you may know, Swing is a graphical widget toolkit for Java. […] Even though it is generally a good thing that JetBrains IDEs and Swing apps are desktop applications, there’s a number of corner cases, like thin clients, that require a special approach. This is where Projector comes in.

Projector is a self-hosted technology that runs IntelliJ-based IDEs and Swing-based apps on the server, allowing you to access them from anywhere using browsers and native apps.

JetBrains believes that remotely running applications on a server with Projector may be valuable in high-security contexts, huge projects, and other contexts where thin clients are valuable. The combination of a powerful server and thin clients is often cheaper and offers a mobility advantage when compared against an equivalent configuration that leverages high-end laptops. Thin clients may also be cheaper to operate, maintain, and secure. Users neither need to install software nor store files on their device. Running Swing applications from a browser frees developers from thinking about the details of their computing environment (e.g., operating system, processor, memory).

One developer explained on Twitter how Projector helps him avoid issues connected to the Windows Subsystem for Linux (WSL):

You know, I think #WSL2 is great… except for its usage with @phpstorm. But WOW, now @jetbrains has released Projector. It’s awesome in so many contexts, opens up new things. But the most obvious is… you just run projector on WSL2 and all your #ddev WSL2 problems are over.

Joaquim Verges, Android lead at Twitch, reported running Android Studio on his mobile:

My personal laptop, a 4-year-old Razer blade with 16 Gb of RAM, starts FLYING as soon as I open Android Studio on one of my personal projects with only a handful of modules. The fans blow louder than when playing a 3D video game, it’s been driving me nuts.
[…] With [JetBrains Projector’s] approach, you can seamlessly code from any device that can run a browser. In fact, here’s Android Studio “running” on my phone, because why not.

Running Android Studio with JetBrains Projector
(Source: Blog post)

[I] chose [to run an AWS] EC2 instance with 8 cores, 32Gb of RAM, and 100 Gb of storage. […] Even if I used it for 8 hours a day, 5 days a week, it would cost me around $64 / month. Not bad considering I don’t need an expensive laptop anymore.
When I want to work on my projects, I just start my EC2 instance, run Projector on it, then open a Chrome tab and I’m ready to code. No more crazy fans, no more overheating!
[…] I went a bit further and set up WiFi debugging between my phone and my laptop, which means I don’t have to deal with any USB cables.

JetBrains additionally mentioned that developers may pair-program remotely, as multiple clients can connect to a server and interact with it in turns. Huge projects that require a long time to start over can be left still on the server while developers switch off their laptops.

Projector leverages a custom implementation of the AWT graphics engine and intercepts drawing commands that emanate from a Swing application. The commands are serialized and sent via WebSockets to clients, which then execute them locally. On the other hand, the client sends user events (e.g., mouse clicks, window resizes) back to the server, events which are then translated to AWT commands.

Unlike other generic remote desktop solutions, which may stream pixels directly, Projector may render neatly fonts and user interface even on slow connections as it specializes its serialization protocol to Java applications and vector fonts. However, some hotkeys are intercepted by the browser (e.g., Ctrl+Q in Windows/Linux, cmd+w on macOS). While there may be a workaround that consists of opening a webpage in app mode, JetBrains also provides separate native apps for macOS, Linux, and Windows as an alternative to the browser client.

Projector is an open-source project that consists of several modules under the Apache License 2.0, GNU GPL v2.0, and MIT license. Contributions are welcome, provided they follow the contributing guidelines.

Rate this Article

Adoption
Style

BT