Linux ubuntu intellij idea

How to install Intellij IDEA on Ubuntu?

I’m new to Ubuntu and Linux in general. I want to code in Java on my computer, but I’m having problems installing IntelliJ IDEA on Ubuntu. I have downloaded and extracted the file and for some reason renamed the folder to idea. I tried moving the folder to /usr/share/applications or something but I didn’t have permission. I used sudo -i in terminal to gain permission but didn’t manage to get out of root folder. Can anyone help me with a step by step way to move the folder, create a shortcut in the search bar or whatever it’s called and install it properly?

It would be easier to install from the Ubuntu Software Center and IntelliJ installed that way works very well in Ubuntu. It should be noted that IntelliJ IDEA is only available in the default repositories of currently supported versions of Ubuntu for Ubuntu 12.04 and Ubuntu 14.04.

Since it’s only available on the software center through third parties and not Jetbrains itself (and therefore not necessarily updated for new versions of jetbrains software or of ubuntu), it’s better to do it the official way, using the toolbox app. See my answer, which has much fewer steps than the accepted one, and is more user friendly.

> «it’s only available on the software center through third parties» — when I look in the software center it says the developer is ‘jetbrains’ with a green tick, which implies it’s from Jetbrains, no?

I know the question was posted before distribution 16.04 (with snapd) was released, but this answer may be worthwhile for anybody reading it from now on: Just have a look at the official website with the explicit command lines to type in a terminal.

12 Answers 12

Note: This answer covers the installation of IntelliJ IDEA. For an extended script, that covers more JetBrains IDEs, as well as help for font rendering issues, please see this link provided by brendan.
Furthermore, a manual Desktop Entry creation is optional, as newer versions of IntelliJ offer to create it on first startup.

I have my intellij int /opt folder. So what I do is:

  • Download Intellij
  • Extract intellij to /opt-folder: sudo tar -xvf -C /opt/ (the -C option extracts the tar to the folder /opt/)
  • Create a Desktop Entry File called idea.desktop (see example file below) and store it anywhere you want (let’s assume in your home directory)
  • Move the idea.desktop from your home directory to /usr/share/applications: sudo mv ~/idea.desktop /usr/share/applications/
Читайте также:  Linux посмотреть сетевое оборудование

Now (in a lot) Ubuntu versions you can start the application after the GUI is restarted. If you don’t know how to do that, you can restart your PC..

idea.desktop (this is for community edition version 14.1.2, you have to change the paths in Exec= and Icon= lines if the path is different for you):

[Desktop Entry] Encoding=UTF-8 Name=IntelliJ IDEA Comment=IntelliJ IDEA Exec=/opt/ideaIC-14.1.2/bin/idea.sh Icon=/opt/ideaIC-14.1.2/bin/idea.png Terminal=false StartupNotify=true Type=Application 

Edit
I also found a shell script that does this for you, here. The given script in the link installs Oracle Java 7 for you and gives you the choice between Community and Ultimate Edition. It then automatically downloads the newest version for you, extracts it and creates a desktop entry.
I have modified the scripts to fulfill my needs. It does not install java 8 and it does not ask you for the version you want to install (but the version is kept in a variable to easily change that). You can also update Intellij with it. But then you have to (so far) manually remove the old folder! This is what i got:

Edit2
Here is the new version of the script. As mentioned in the comments, breandan has updated the script to be more stable (the jetbrains website changed its behavior). Thanks for the update, breandan.

#!/bin/sh echo "Installing IntelliJ IDEA. " # We need root to install [ $(id -u) != "0" ] && exec sudo "$0" "$@" # Attempt to install a JDK # apt-get install openjdk-8-jdk # add-apt-repository ppa:webupd8team/java && apt-get update && apt-get install oracle-java8-installer # Prompt for edition #while true; do # read -p "Enter 'U' for Ultimate or 'C' for Community: " ed # case $ed in # [Uu]* ) ed=U; break;; # [Cc]* ) ed=C; break;; # esac #done ed=C # Fetch the most recent version VERSION=$(wget "https://www.jetbrains.com/intellij-repository/releases" -qO- | grep -P -o -m 1 "(?) # Set download directory DEST=~/Downloads/$FILE echo "Downloading idea-I$ed-$VERSION to $DEST. " # Download binary wget -cO $ $ --read-timeout=5 --tries=0 echo "Download complete!" # Set directory name DIR="/opt/idea-I$ed-$VERSION" echo "Installing to $DIR" # Untar file if mkdir $; then tar -xzf $ -C $ --strip-components=1 fi # Grab executable folder BIN="$DIR/bin" # Add permissions to install directory chmod -R +rwx $ # Set desktop shortcut path DESK=/usr/share/applications/IDEA.desktop # Add desktop shortcut echo -e "[Desktop Entry]\nEncoding=UTF-8\nName=IntelliJ IDEA\nComment=IntelliJ IDEA\nExec=$/idea.sh\nIcon=$/idea.png\nTerminal=false\nStartupNotify=true\nType=Application" -e > $ # Create symlink entry ln -s $/idea.sh /usr/local/bin/idea echo "Done." 

Old Version

#!/bin/sh echo "Installing IntelliJ IDEA. " # We need root to install [ $(id -u) != "0" ] && exec sudo "$0" "$@" # define version (ultimate. change to 'C' for Community) ed='U' # Fetch the most recent community edition URL URL=$(wget "https://www.jetbrains.com/idea/download/download_thanks.jsp?edition=I$&os=linux" -qO- | grep -o -m 1 "https://download.jetbrains.com/idea/.*gz") echo "URL: $" echo "basename(url): $(basename $)" # Truncate filename FILE=$(basename $) echo "File: $" # Download binary wget -cO /tmp/$ $ --read-timeout=5 --tries=0 # Set directory name DIR="$" # Untar file if mkdir /opt/$; then tar -xvzf /tmp/$ -C /opt/$ --strip-components=1 fi # Grab executable folder BIN="/opt/$DIR/bin" # Add permissions to install directory chmod 755 $/idea.sh # Set desktop shortcut path DESK=/usr/share/applications/IDEA.desktop # Add desktop shortcut echo -e "[Desktop Entry]\nEncoding=UTF-8\nName=IntelliJ IDEA\nComment=IntelliJ IDEA\nExec=$/idea.sh\nIcon=$/idea.png\nTerminal=false\nStartupNotify=true\nType=Application" > $ echo "Done." 

Источник

Читайте также:  Linux ubuntu правильная установка

How to Install IntelliJ IDEA on Ubuntu and Other Linux Distributions

This tutorial shows you various ways for installing IntelliJ IDEA on Ubuntu, Linux Mint, elementary OS, Linux Lite and other Linux distributions.

  • IntelliJ IDEA Community Edition (Free)
  • IntelliJ IDEA Ultimate Edition (Paid version with extra features)
  • IntelliJ IDEA Educational (Ultimate Edition but free for students and faculty members)

I am not going to dive into the features of IntelliJ IDEA or which edition is better. You can read about the difference between the Community and the Ultimate Edition here.

I presume that since you have come to read this post, you are already aware of the advantages of using IntelliJ IDEA. In an earlier post, I showed you how to install PyCharm on Ubuntu. In this post, let me show you how to install IntelliJ IDEA on Ubuntu and other Linux distributions.

Install IntelliJ IDEA on Ubuntu and other Linux distributions

IntelliJ Idea running in Ubuntu

Before we go on installing IntelliJ on Ubuntu, please make sure that you have Java on your system. Read this post to see how to install Java on Ubuntu.

Once you have ensured that, let’s go on with IntelliJ installation. There are several ways of installing IntelliJ IDEA on Ubuntu and other Linux distributions.

  • Install it from the Software Center [Recommended]
  • Install it using Snap (valid for most Linux distributions)
  • Install it using Flatpak (valid for most Linux distributions)
  • Install it using unofficial PPA in Ubuntu-based distributions

Method 1: Install IntelliJ IDEA from the Software Center [Recommended for Ubuntu Users]

The good news is that all variants of IntelliJ IDEA are available in the Software Center. You have to search IntelliJ IDEA and it will show the possible results.

Installing IntelliJ IDEA is available in Ubuntu via the Software Center

You have to select the preferred version and then click on the install button.

Installing IntelliJ IDEA in Ubuntu via the Software Center

This would be the simplest method for Ubuntu users.

Method 2: Install IntelliJ IDEA in Linux using Snap packages [for all Linux distributions]

The apps in the Software Center are basically the Snap packages. Snap packages are supported by all major Linux distributions and you can easily install several applications through Snap.

Читайте также:  Vmware workstation linux shared folder

First, make sure that you have Snap support on your Linux distribution. After that, you can use the following commands to install various IntelliJ versions.

sudo snap install intellij-idea-ultimate --classic

For the community version:

sudo snap install intellij-idea-community --classic

For the educational version:

sudo snap install intellij-idea-educational --classic

Method 3: Install IntelliJ IDEA using Flatpak [for all Linux distributions]

Like Snap, Flatpak is also a universal packaging system and is supported by a number of major Linux distributions.

Again, you should make sure that you have Flatpak installed on your system. And then, you should go and download the flatpakref installer files from the Flathub website.

IntelliJ IDEA Flatpak package

Clicking on install will download the flatpakref files. You can then switch to your Download folder where the flatpakref files has been saved and use the following command to install it:

flatpak install com.jetbrains.IntelliJ-IDEA-Community.flatpakref

The above described command is for the Community edition. You can use a similar approach for the Ultimate edition as well.

IntelliJ IDEA running on Ubuntu 16.04

Method 4: Install IntelliJ using PPA (valid for Ubuntu-based Linux distros)

There is an unofficial PPA available that you can use to easily install IntelliJ in Linux Mint, elementary OS and other Ubuntu-based Linux distributions, including Ubuntu of course.

This PPA is developed and maintained by Marcel Kapfer and is available for Ubuntu 18.04, 16.04, 18.10, 19.04 and 16.04. So basically, it covers all the active Ubuntu versions and Linux distros based on them.

Open a terminal and use the commands below:

sudo add-apt-repository ppa:mmk2410/intellij-idea-communitysudo apt updatesudo apt install intellij-idea-community

Only the Community version is available via this PPA, unfortunately. The PPA will download the IDE, so again installation time will depend on your internet connection.

To remove IntelliJ installed from the above PPA, use the command below:

sudo apt remove intellij-idea-community sudo add-apt-repository --remove ppa:mmk2410/intellij-idea-community

What else?

If you are old school, you can take the hard road and install ItelliJ IDEA from its source code. It’s limited to Community edition, though. You can browse the source code on its GitHub repository.

You can browse and download the source code on its GitHub repository.

The main part of installing an IDE comes into configuration but I am more of a C++ guy than Java so I leave that part to you 🙂

I hope this post helped you to install IntelliJ on Ubuntu and other Linux distributions. If you have questions, suggestions or a word of thanks, feel free to drop a comment below.

Источник

Оцените статью
Adblock
detector