LinuxCommandLibrary

idea

Run IntelliJ IDEA IDE

TLDR

Open the current directory in IntelliJ IDEA

$ idea [path/to/directory]
copy

Open a specific file or directory in IntelliJ IDEA
$ idea [path/to/file_or_directory]
copy

Open the diff viewer to compare up to 3 files
$ idea diff [path/to/file1 path/to/file2 path/to/optional_file3]
copy

Open the merge dialog to perform a two-way file merge
$ idea merge [path/to/file1] [path/to/file2] [path/to/output]
copy

Run code inspections on a project
$ idea inspect [path/to/project_directory] [path/to/inspection_profile] [path/to/output]
copy

SYNOPSIS

idea [options] [path]

PARAMETERS

-h, --help
    Display usage help and exit.

-d <path>
    Set the specified directory as project root.

<path>
    Optional path to project directory or file to open.

DESCRIPTION

The idea command is a convenience shell script distributed with JetBrains IntelliJ IDEA, a powerful cross-platform IDE primarily for Java development but supporting numerous languages via plugins. On Linux, it simplifies launching the IDE, handling JVM setup, memory allocation, and project loading.

Typically installed by extracting the official tarball to /opt/idea-* and creating a symlink like ln -s /opt/idea-2024.1/bin/idea.sh /usr/local/bin/idea. Running idea opens the recent projects screen or last project; specifying a path opens that project directory or file.

It respects user configurations in ~/.config/JetBrains/IntelliJIdea*/ or ~/.IntelliJIdea*, including VM options for heap size (idea.vmoptions). The script detects system properties, sets $JAVA_HOME if needed, and supports both Oracle JDK and OpenJDK.

Key benefits include integrated debugging, refactoring, Git support, and Maven/Gradle integration. It's widely used by developers for professional workflows. Note: versions update frequently; command path may change with new releases unless managed via JetBrains Toolbox.

CAVEATS

Not a core Linux utility; requires manual or Toolbox installation of IntelliJ IDEA and a compatible JDK. Script location varies by version (e.g., /opt/idea-*/bin/idea.sh). JVM args must precede options or go in config files.

INSTALLATION

Download tar.gz from jetbrains.com/idea/download, extract to /opt/, symlink idea.sh to /usr/local/bin/idea. Or use JetBrains Toolbox for management.

CONFIGURATION

Edit ~/.config/JetBrains/IntelliJIdea*/idea.vmoptions for JVM tweaks like -Xmx4096m. Plugins via IDE UI.

HISTORY

Introduced with early Linux support for IntelliJ IDEA (2001 by JetBrains). Script evolved from basic launcher to handle multi-JDK, HiDPI, and Wayland. Toolbox app (2017+) automates updates, symlinks.

SEE ALSO

java(1), javac(1)

Copied to clipboard