Skip to content

Instantly share code, notes, and snippets.

@jdewinne
Last active December 26, 2017 03:48
Show Gist options
  • Save jdewinne/28e39f642b96b296cd22137dbe15c3f0 to your computer and use it in GitHub Desktop.
Save jdewinne/28e39f642b96b296cd22137dbe15c3f0 to your computer and use it in GitHub Desktop.
install intellij
#!/bin/sh
echo "Installing IntelliJ IDEA..."
# We need root to install
# Fetch the most recent ultimate edition URL
URL="https://download.jetbrains.com/idea/ideaIU-2017.3.1-no-jdk.tar.gz"
INSTALLATION_DIR="/opt/idea"
# Download the tarball, unpack and install
curl -L -o $HOME/idea.tar.gz ${URL}
if tar -xf $HOME/idea.tar.gz --directory=$HOME; then
# Remove the installation folder and the symlink, they might already exist
sudo rm -rf $INSTALLATION_DIR /bin/idea
sudo mv $HOME/idea-IU-* $INSTALLATION_DIR
sudo ln -s -f $INSTALLATION_DIR/bin/idea.sh /bin/idea
fi
rm $HOME/idea.tar.gz
# Add to applications list (thanks 4ndrej)
cat >$INSTALLATION_DIR/idea.desktop <<EOL
[Desktop Entry]
Name=IntelliJ IDEA
Comment=The Most Intelligent Java IDE
Exec=/usr/bin/idea
Terminal=false
Type=Application
StartupNotify=true
Icon=/opt/idea/bin/idea.png
Categories=Development;IDE;Debugger;Profiling
EOL
sudo ln -s -f $INSTALLATION_DIR/idea.desktop /usr/share/applications/idea.desktop
echo ""
echo "Idea installed successfully!"
echo "Run with: idea"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment