<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Niklas' Random Stuff]]></title><description><![CDATA[Niklas' Random Stuff]]></description><link>https://blog.niklas.tech</link><generator>RSS for Node</generator><lastBuildDate>Fri, 11 Sep 2026 19:15:14 GMT</lastBuildDate><atom:link href="https://blog.niklas.tech/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[IntelliJ and Java on Immutable Linux]]></title><description><![CDATA[Immutable Linux Distributions are the future of the Linux Desktop. Simply deploying an image and keeping the core filesystem read-only has many advantages, including increased reliability and decreased breakage from system packages. It also presents ...]]></description><link>https://blog.niklas.tech/intellij-and-java-on-immutable-linux</link><guid isPermaLink="true">https://blog.niklas.tech/intellij-and-java-on-immutable-linux</guid><category><![CDATA[IntelliJ IDEA for linux]]></category><category><![CDATA[intellij]]></category><category><![CDATA[Linux]]></category><category><![CDATA[immutable]]></category><category><![CDATA[development environments]]></category><dc:creator><![CDATA[Niklas]]></dc:creator><pubDate>Sun, 06 Aug 2023 13:02:19 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/stock/unsplash/xrVDYZRGdw4/upload/b145213045a3c5fe50f659ed8bcc40c8.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Immutable Linux Distributions are the future of the Linux Desktop. Simply deploying an image and keeping the core filesystem read-only has many advantages, including increased reliability and decreased breakage from system packages. It also presents a lot of challenges for folks who need code on their machines, be it in Java or other programming environments, especially when they want to use a Jetbrains IDE.</p>
<p>In this article, we will cover the process of setting up a Java Dev Environment (the steps can be replicated for every other environment, such as NodeJS, Rust and Python, btw.) on Fedora Kinoite with the help of Distrobox and Podman. Let's get started! (*snap*)</p>
<h1 id="heading-getting-your-ide-installed">Getting your IDE installed</h1>
<p>The first order of business is to get your IDE installed. I did this via JetBrains Toolbox on the Host OS and not in a container. Since we can access our home directory, in which Toolbox installs the IDEs, later in our dev container anyway, this is not an issue. It is also preferred if you want to use the same IDE in multiple different environments.</p>
<p>Download Toolbox from this link: <a target="_blank" href="https://www.jetbrains.com/toolbox-app/">https://www.jetbrains.com/toolbox-app/</a></p>
<p>Extract the archive and run the provided AppImage. JetBrains Toolbox will pop up in a welcome window to accept their terms and conditions. Once that's done, you can install IntelliJ on your system.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1691324980014/911cfd62-18fd-4971-86ae-6882efebd4cd.png" alt class="image--center mx-auto" /></p>
<p>We don't need to do anything with this now, until later.</p>
<h1 id="heading-setting-up-a-development-container">Setting up a development container</h1>
<p>First make sure you have Distrobox installed on your system (in my case it already came with the system image provided by https://universal-blue.org, awesome stuff they're doing over there btw!). Instructions for installing Distrobox on your system can be found here: <a target="_blank" href="https://github.com/89luca89/distrobox#installation">https://github.com/89luca89/distrobox#installation</a></p>
<p>Let's whip up a terminal if you haven't already. :P</p>
<p>First let's create a new container with Distrobox:</p>
<p><code>distrobox create --name javabox -H /home/niklas/.homes/javabox --image fedora</code></p>
<p>Adjust names and paths as necessary. After it's created, enter it for the first time with:</p>
<p><code>distrobox enter javabox</code></p>
<p>Distrobox will configure, update and install a bunch of stuff. Give it a few good minutes and take a sip from your coffee.</p>
<p>Output should look like this:</p>
<pre><code class="lang-bash">niklas@fedora /v/h/niklas&gt; distrobox enter javabox
Container javabox is not running.
Starting container javabox
run this <span class="hljs-built_in">command</span> to follow along:

 podman logs -f javabox

 Starting container...                           [ OK ]
 Installing basic packages...                    [ OK ]
 Setting up read-only mounts...                  [ OK ]
 Setting up read-write mounts...                 [ OK ]
 Setting up host<span class="hljs-string">'s sockets integration...        [ OK ]
 Setting up read-write mounts...                 [ OK ]
 Setting up host'</span>s sockets integration...        [ OK ]
 Integrating host<span class="hljs-string">'s themes, icons, fonts...      [ OK ]
 Setting up package manager exceptions...        [ OK ]
 Setting up rpm exceptions...                    [ OK ]
 Setting up sudo...                              [ OK ]
 Setting up groups...                            [ OK ]
 Setting up users...                             [ OK ]
 Setting up package manager exceptions...        [ OK ]
 Setting up rpm exceptions...                    [ OK ]
 Setting up sudo...                              [ OK ]
 Setting up groups...                            [ OK ]
 Setting up users...                             [ OK ]
 Executing init hooks...                         [ OK ]

Container Setup Complete!
Welcome to fish, the friendly interactive shell
Type help for instructions on how to use fish
niklas@javabox /v/h/niklas&gt; cd ~</span>
</code></pre>
<p>Let's install the OpenJDK 17 Runtime with:</p>
<pre><code class="lang-bash">sudo dnf install java
</code></pre>
<p>Again, give dnf a good few minutes so it can setup and download everything properly.</p>
<p>Now comes a bit of a janky part. We need to copy the IntelliJ Desktop File, which was created by Toolbox when we installed IJ earlier, to the <code>/usr/share/applications/</code> directory where the Distrobox-Export script can find it. Do it like so (adjust folders and names accordingly):</p>
<pre><code class="lang-bash">sudo cp /var/home/niklas/.<span class="hljs-built_in">local</span>/share/applications/jetbrains-idea.desktop /usr/share/applications/javabox-idea.desktop
</code></pre>
<p>Now we can export the IDE to run in the container with <code>distrobox-export</code> :</p>
<pre><code class="lang-bash">distrobox-export --app idea
</code></pre>
<p>With that done, you should see an entry in your application list / menu that looks similar to this (notice the <code>(on javabox</code> which is the import part here):</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1691326145840/99073032-892f-431d-ad57-af3f34cc35a8.png" alt /></p>
<p>Your IDE should start up like it were installed on a normal Host OS:</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1691326445507/0179c7ae-781f-41da-88f4-18cadff5a087.png" alt class="image--center mx-auto" /></p>
<p>Now we need to login to activate the IDE. But clicking on the button does not open the browser.</p>
<h1 id="heading-fix-host-browser-not-opening">Fix Host browser not opening</h1>
<p>To fix this, we need only a simple command:</p>
<p>We need to make a symlink to the <code>distrobox-host-exec</code> script which will forward our request to the host OS, which will handle the request from <code>xdg-open</code> .</p>
<pre><code class="lang-bash">sudo ln -s /usr/bin/distrobox-host-exec /usr/<span class="hljs-built_in">local</span>/bin/xdg-open
</code></pre>
<p>After that, relaunch the IDE, the browser should now open and you can login to your browser.</p>
<p>That's it. You now have a fully-functional Jetbrains IDE which you can use your container and not clutter your host OS with development libraries and other dependencies.</p>
<h4 id="heading-sources">Sources:</h4>
<p><a target="_blank" href="https://github.com/89luca89/distrobox/issues/194#issuecomment-1445032633">https://github.com/89luca89/distrobox/issues/194#issuecomment-1445032633</a></p>
<p><a target="_blank" href="https://youtrack.jetbrains.com/issue/GTW-2846">https://youtrack.jetbrains.com/issue/GTW-2846</a></p>
]]></content:encoded></item></channel></rss>