Keywords: IntelliJ IDEA | Ubuntu Installation | Linux Development Environment
Abstract: This article provides a detailed overview of multiple methods for installing IntelliJ IDEA on Ubuntu, with a focus on manual installation procedures including file extraction, permission management, and desktop shortcut creation. By comparing the advantages and disadvantages of different installation approaches, it helps users select the most suitable solution based on their needs, and includes complete automated scripting options.
Installation Method Overview
There are four main approaches to installing IntelliJ IDEA on Ubuntu systems: manual installation, using PPA repositories, through the Toolbox application, and utilizing Snap or Ubuntu Make tools. Each method has its specific use cases and characteristics, allowing users to choose based on their technical expertise and requirements.
Detailed Manual Installation Steps
Manual installation provides the most control and is ideal for users who want to understand Linux system operations thoroughly. Begin by downloading the Linux version of IntelliJ IDEA from the JetBrains website, typically in tar.gz format. After downloading, extract the files to the /opt directory, which is the standard location for optional application software in Linux systems.
Use the following command for extraction: sudo tar -xvf <intellij.tar> -C /opt/. The -C parameter specifies the target directory. After extraction, set appropriate permissions for the installation directory to ensure regular users can execute program files normally.
Desktop Shortcut Creation
Creating desktop shortcuts is essential for integrating IntelliJ IDEA into the Ubuntu desktop environment. This requires creating a .desktop file, which is the standard application launcher format in Linux desktop environments. The file must contain basic application information, execution commands, and icon paths.
Example idea.desktop file content: [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
After creation, move the file to the /usr/share/applications directory: sudo mv ~/idea.desktop /usr/share/applications/. You may need to restart the graphical interface or system for the shortcut to take effect.
Automated Installation Script
For users who frequently install or update IntelliJ IDEA, automated scripts significantly improve efficiency. Below is an optimized installation script example:
#!/bin/sh
echo "Installing IntelliJ IDEA..."
# We need root to install
[ $(id -u) != "0" ] && exec sudo "$0" "$@"
# Define edition (C for Community, U for Ultimate)
ed=C
# Fetch the most recent version
VERSION=$(wget "https://www.jetbrains.com/intellij-repository/releases" -qO- | grep -P -o -m 1 "(?<=https://www.jetbrains.com/intellij-repository/releases/com/jetbrains/intellij/idea/BUILD/)[^/]+(?=/)")
# Construct download URL
URL="https://download.jetbrains.com/idea/ideaI$ed-$VERSION.tar.gz"
# Set download destination
DEST=~/Downloads/$(basename ${URL})
echo "Downloading idea-I$ed-$VERSION to $DEST..."
# Download the package
wget -cO ${DEST} ${URL} --read-timeout=5 --tries=0
echo "Download complete!"
# Set installation directory
DIR="/opt/idea-I$ed-$VERSION"
echo "Installing to $DIR"
# Create directory and extract files
if mkdir ${DIR}; then
tar -xzf ${DEST} -C ${DIR} --strip-components=1
fi
# Set executable path
BIN="$DIR/bin"
# Set permissions
chmod -R +rwx ${DIR}
# Create desktop shortcut
DESK=/usr/share/applications/IDEA.desktop
echo -e "[Desktop Entry]\nEncoding=UTF-8\nName=IntelliJ IDEA\nComment=IntelliJ IDEA\nExec=${BIN}/idea.sh\nIcon=${BIN}/idea.png\nTerminal=false\nStartupNotify=true\nType=Application" > ${DESK}
# Create symbolic link for terminal access
ln -s ${BIN}/idea.sh /usr/local/bin/idea
echo "Done."This script automates version detection, downloading, extraction, permission setting, and shortcut creation, significantly simplifying the installation process.
Comparison of Alternative Methods
Beyond manual installation, users can consider these alternatives:
1. PPA Repository Installation: By adding third-party PPA repositories, users can install directly using apt-get commands. This method is simple and quick but depends on the update frequency of third-party maintainers.
2. JetBrains Toolbox: The official unified management tool from JetBrains facilitates easy installation, updating, and management of all JetBrains products. Particularly suitable for developers using multiple JetBrains tools.
3. Snap Package Installation: Supported from Ubuntu 16.04, this packaging format offers automatic updates and sandbox security features.
4. Ubuntu Make Tool: An official Ubuntu tool for configuring development environments, simplifying the installation of various IDEs.
Troubleshooting Common Issues
Permission issues may arise during installation, especially when attempting to copy files to system directories. Always use sudo for operations requiring administrative privileges, but remember to exit root mode promptly after completion.
If desktop shortcuts don't appear immediately, try restarting the graphical interface or the entire system. Newer versions of IntelliJ IDEA automatically create desktop shortcuts upon first launch, further simplifying installation.
When selecting an installation method, consider your Ubuntu version, personal technical preferences, and automatic update requirements. For production environments, manually controlled installation or the official Toolbox is recommended; for personal development setups, more convenient PPA or Snap installations may be preferable.