WSL

Running IntelliJ IDEA in WSLg (Window 11)

Posted by ChenRiang on August 5, 2021

I have been using WSL for development for sometime and turn up 80% of my tools has moved to WSL instead of native Window. However, if you’re a WSL heavy user like me, you will surely understand the pain not able to use Linux GUI application natively. Recently, Microsoft has started a project called, WSLg (Windows Subsystem for Linux GUI) to support WSL running Linux application. In this article, I’m going to talk about running IntelliJ IDEA IDE with WSLg.

Pre-Requisite

As of the time of writing, we will have to join the Window Insider program to get the WSL update. Once you’re registered for the program, just click window update and let Microsoft take care of it :)

After you get the latest version of Window, just launch CMD or PowerShell and type the following :

1
wsl --update

Once the WSL updated, restart it with following command:

1
wsl --shutdown

Launch Linux GUI

Now we can try install some Linux GUI application.

1
sudo apt install nautilus -y

After installation done, just simply hit nautilus in the WSL command line and you will notice the it will the application launched!

Install IntelliJ IDEA IDE

I’ll be using Jetbrain’s Toolbox to install the IDE.

  1. Download the tarball .tar.gz from the official website.

  2. Extract the folder out. E.g.

    1
    
    sudo tar -xzf jetbrains-toolbox-1.17.7391.tar.gz -C /opt
    
  3. Execute the application and click Install button on the version that you wish to installed.

(IntelliJ Community version installed)

If everything installed correctly you will notice there is shortcut added to the start menu.

Question: No shortcut added to my start menu! What should I do?

Check out this directory ~/.local/share/applications there should be a file named jetbrains-idea-ce.desktop in it.

1
ls ~/.local/share/applications

Move the file to /usr/share/applications.

1
2
cd ~/.local/share/applications
sudo cp *.desktop /usr/share/applications

Done.

Refer similar issue, here