Scripted Download of IntelliJ IDEA Linux

已回答

I am creating a bash script to setup a freshly installed Linux workstation.

Some applications are not available through the Linux distribution package manger, like IntelliJ IDEA. Those I download from the internet.

However I cannot find a proper URL to download IntelliJ IDEA with either curl or wget

https://www.jetbrains.com/idea/download/?section=linux

Clicking on Download there gives this URL.
https://www.jetbrains.com/idea/download/download-thanks.html?platform=linux

Is there any way I can script this download from Jetbrains Download URL?

0

Seems to be a Jetbrains API I could use

    download_url=$(
        curl -fsSL "https://data.services.jetbrains.com/products/releases?code=IIU&latest=true&type=release" |
        python3 -c "import sys, json; d=json.load(sys.stdin); print(d['IIU'][0]['downloads']['linux']['link'])"
    )
    log_info "Downloading from: ${download_url}"
    curl -L "${download_url}" -o "${TEMP_DIR}/intellij.tar.gz"
    tar -zxf "${TEMP_DIR}/intellij.tar.gz" -C "${INSTALL_DIR}"
0

Hi,

Your snippet works. The data.services.jetbrains.com/products/releases API is the right choice when the script needs the JSON metadata, version string, build number, SHA256, and the per-platform download link.

If all you need is the archive itself, there's a shorter URL that returns a 302 to the same CDN file, so no JSON parsing is required:

curl -L -o intellij.tar.gz "https://download.jetbrains.com/product?code=IIU&latest&distribution=linux"

code selects the product (IIU = IntelliJ IDEA Ultimate, IIC = Community). distribution accepts linux, linuxARM64, windows, windowsARM64, mac, macM1.

A 2018 community thread covers the same pattern with the full list of product codes and a sample Bash script: https://intellij-support.jetbrains.com/hc/en-us/community/posts/207155515-Programmatically-download-latest-version

1

Is IIU and IIC still needed, considered that Jetbrains now only has one version (no longer an Ultimate version).

0

Good question, code=IIU is the right code to keep using. Today it resolves to 2026.1.2 (build 261.24374.151).

code=IIC still resolves, but only because the API continues to serve the last separately-built Community Edition.

0

请先登录再写评论。