19

I would like to use

idea pom.xml

from command line to launch a simple Maven project, and so I think I need to configure using "Create Command-line Launcher" the script path, but I cannot find it in Intellij Ultimate, if I search it in File / Settings I can find it, but then if I add a keyboard shortcut it doesn't work.

Could someone help me?

Thank you

5
  • What OS do you use? This option is not available on Windows, otherwise you can find it in the Tools menu.
    – CrazyCoder
    Commented Sep 21, 2017 at 19:07
  • I'm in linux and it doesn't exist also. Version community 2019.1 EAP. If I try with find action, it is displayed grayed out.
    – Tonsic
    Commented Jan 28, 2019 at 17:40
  • 2
    Discovered that when using Jetbrains Toolbox, there is an official way to generate the script. Enter in the toolbox->settings (the gear next to the 'Log in' button), there will be a "Generate shell scripts" option and location to set. However, even after setting that, and restarting the toobox, it did not generate the script in that path for me.
    – Tonsic
    Commented Jan 28, 2019 at 18:52
  • 1
    Lol.. dumb me.. just take care not to set there a folder that you can only access with sudo. If you do that, it will fail silently the creation of the script. I have set /usr/local/bin and it failed... sorry
    – Tonsic
    Commented Jan 28, 2019 at 19:00
  • You can use the "Create shell scripts" in the toolbox, but it kinda sucks, because it continues in the terminal. If you want functionality similar to code . or atom . or gedit . - check this out: medium.com/@radomir.wojtera/…
    – tiriana
    Commented Jul 17 at 7:06

6 Answers 6

44

For Mac OS with +2019 Intellij:

  1. You'll need JetBrains ToolBox
  2. Turn on Generate shell scripts (no longer in tools > create command line launcher) enter image description here
  3. Set path to /usr/local/bin/
  4. Delete your old executable in /usr/local/bin/
  5. Quit and re-launch toolbox
6
  • 14
    Mine wasn't creating on /usr/local/bin. Figured it was because of permissions and had it create on /home/lucas/.local/share/JetBrains/Toolbox/bin instead. Worked like a charm. Commented Jun 16, 2019 at 21:01
  • 1
    I had to echo my Path first with echo $PATH then I figured I had to use /Users/lmuzquiz/bin instead Commented Apr 29, 2020 at 18:57
  • Also works on linux Commented Nov 29, 2021 at 23:52
  • for macOS: I tried several path , only when I set /Users/[WHO ARE YOU]/bin, It works. Commented Jan 12, 2022 at 7:50
  • 1
    If you are getting the error /usr/local/bin now writable or something along this line, then try this command sudo chown -R whoami:admin /usr/local/bin . Worked for me. Source: youtrack.jetbrains.com/issue/TBX-6792
    – Sulphur
    Commented Mar 2, 2023 at 15:36
6

As I said in the comments of the question.

At least when using Idea Community 2019.1 EAP + Jetbrains Toolbox, even in Linux that option is disabled.

You must access the Jetbrains Toolbox->settings (the gear next to the 'Log in' button), there will be a "Generate shell scripts" option and location to set. Set a location that you can access without sudo, and put that location on your PATH or copy the generated script to a path like /usr/local/bin.

I needed that to be able to use kscript --idea xxxx.kts (putting this here so that the next person googling that finds the answer :) )

5

This option is not available on Windows, otherwise you can find it in the Tools menu.

Tools | Create Command-line Launcher (available on Mac/Linux).

If IDE installation is managed by the JetBrains Toolbox, launcher options will not be available in the IDE and you should use Toolbox settings to create a launcher instead.

3

When installing the 2019.1 IDE version via toolbox, you need first to remove the previously generated Command-Line Launcher (e.g. via Tools | Create Command-line Launcher)

Then Enable the Generate Shell script option ToolBox and specify the same path that was used before (e.g /use/local/bin/)

0

On Linux, installing IntelliJ IDEA as a snap package automatically creates the command-line launcher named intellij-idea-community or intellij-idea-ultimate. The Tools | Create Command-line Launcher command is therefore not available.

Check this link for more information on enabling it on Windows,macOS and Linux.

0

For Toolbox version: after a long search I ended up writing this snippet and putting it in ~/.profile

alias idea="$(find ~/.local/share/JetBrains/Toolbox/apps/IDEA-U/ch-0 -maxdepth 1 -type d -name "2*" -not -name "*plugins" -printf "%T@ %p\n" | sort -nr | head -n 1 | rev | cut -d ' ' -f '1' | rev)/bin/idea.sh"

Here's a gist with this command https://gist.github.com/tiriana/9a163cd5436158d93c89e0d20b99caa9.js

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.