There are a handful of editors and Integrated Development Environments (IDE) for Java. However, IntelliJ IDEA beats them all hands down when it comes to features and productivity. Eclipse fans don’t take me wrong. I was an Eclipse fan but after switching to IntelliJ IDEA I never looked back. IntelliJ IDEA does not stop with being a better Java IDE. It goes beyond and supports the entire Java ecosystem. After all, it also provides a free and open-source community edition. When it comes to installing on Linux, there are different ways to get IntelliJ IDEA. On the other hand, you can have different Linux distributions including but not limited to Debian, Ubuntu, CentOS, Fedora, Arch, or Gentoo. This article explains a distribution-agnostic method to install IntelliJ IDEA.

Download IntelliJ IDEA

Download the latest version of IntelliJ IDEA from the official website. The community edition 2022.2.4 is used in this article to explain the process but download the latest version and change the commands accordingly.

Installation

Step 1:
Open the terminal (Ctrl + Alt + T) and enter the following command to change the directory.

cd /opt

Step 2:
Extract the ideaIC-2022.2.4.tar.gz file in the opt directory using the following command.

sudo tar -xvzf ~/Downloads/ideaIC-2022.2.4.tar.gz

The above command assumes the IntelliJ IDEA binary archive filename is ideaIC-2022.2.4.tar.gz and it is located in the ~/Downloads folder. If your downloaded file is in any other location, change the command according to your path.


Step 3 (Optional):
In case you are the admin user of the system or the only user using your computer, you can change the permissions of the IntelliJ IDEA using the following command to allow you to make any changes in the IntelliJ installation folder. This will later allow you to upgrade IntelliJ IDEA from the application itself without requiring sudo permission. Note that JetBrains normally releases a new version of IntelliJ IDEA every month. Sometimes even twice a month. It is an annoyance to upgrade IntelliJ without user permission.

sudo chown -R $USER:$USER /opt/idea

Step 4:
Once installed, you can keep your copy updated from the IDE itself. Therefore, it doesn’t make sense to keep the version number in the extracted directory. Use the following command to rename the folder. Depending on the version you have downloaded, the original folder name can be different.

sudo mv idea-IC-222.4459.24 idea

Step 5:
Start the IntelliJ IDEA for the first time from the terminal by using the following command.

/opt/idea/bin/idea.sh

Step 6:
Accept the user agreement and continue. In the opened window, click the gear icon in the bottom left corner and select Create Desktop Entry… menu.

In the appeared dialog, select the checkbox if you want to create the desktop entry for all users on your computer and click OK. If you have chosen to create the desktop entry for all users, another prompt will ask you to give sudo access so that IntelliJ can create the menu entry for all users.


Step 7:
Now you can close the IntelliJ IDEA window and close the terminal. Search for IntelliJ IDEA in your application menu and start using it just like any other application. If you have any questions or feedback related to this article, please comment below.

IntelliJ IDEA comes with its own Java Runtime Environment. However, it is highly recommended to deploy an external Java Development Kit for your development purposes. If you haven’t installed it already, install any version of Oracle Java Development Kit on Linux by following this article: Install The Latest Oracle JDK on Linux.

Share.
Exit mobile version