1

On Pop_os:

when in a project folder I want to type "intellij ." and have the project open in intellij.

Official instructions say go to the main menu and use "Tools / Create command-line launcher".... but this gives me this error

Launcher script creation failed: Cannot `sudo` on this system - no suitable utils found

Can someone help me out the maze before Voldemort takes my sanity away?

thefonso
  • 3,220
  • 6
  • 37
  • 54
  • Do you have `sudo` installed? What does the terminal say when you open it and type `sudo`? – TobTobXX Oct 26 '21 at 19:18
  • 1
    yep...sudo is present – thefonso Oct 26 '21 at 19:21
  • Did you install the IDE from tar.gz or via flatpack/snap so that it's in the sandboxed environment? – CrazyCoder Oct 26 '21 at 19:24
  • flatpack/snap via Pop_Shop – thefonso Oct 26 '21 at 19:28
  • 1
    Use the normal tar.gz instead: https://www.jetbrains.com/idea/download/index.html. `sudo` is not available inside snap. – CrazyCoder Oct 26 '21 at 19:29
  • [IntelliJ thinks it needs superuser privileges](https://intellij-support.jetbrains.com/hc/en-us/community/posts/360006413980-Create-launcher-script-fails-with-127-on-ubuntu-18-04-LTS) "It is needed to execute system binaries, etc". Sounds fishy to me. Why would an IDE ever need root? – n. m. could be an AI Oct 26 '21 at 19:43
  • @n.1.8e9-where's-my-sharem. This functionality is open source, go ahead and study the source code on IntelliJ IDEA Community GitHub project to see why root is needed (hint: you can't install launcher shortcut into `/usr/bin` without root). – CrazyCoder Oct 26 '21 at 19:56
  • @CrazyCoder woohoo! You have helped me escape Voldemort. Much appreciation! – thefonso Oct 26 '21 at 19:58
  • @CrazyCoder "you can't install launcher shortcut into /usr/bin without root" why would I want to do such a crazy thing? – n. m. could be an AI Oct 26 '21 at 20:33
  • 1
    @n.1.8e9-where's-my-sharem. It's a common practice to install binaries in `PATH` so that you can type `idea` and open the IDE from anywhere in the Terminal. Just convenience. – CrazyCoder Oct 26 '21 at 20:56

1 Answers1

1

snap/flatpack limits access to the file system and the apps run in the sandbox, hence the problem. Use the standard .tar.gz distribution instead.

CrazyCoder
  • 389,263
  • 172
  • 990
  • 904
  • Thank you! Helped me to understand the problem. However, I would hate to re-install my intellij. Is there any chance to somehow generate *.sh manually? I thought it's just a couple of bash code lines inside *.sh file, no? – skryvets Mar 07 '22 at 16:31
  • 1
    @skryvets You should be able to [call the default IDE startup script](https://stackoverflow.com/a/16989110/104891) from your bash script or just create a symlink to the default startup script in PATH. See https://intellij-support.jetbrains.com/hc/en-us/articles/360011901879-How-to-start-IDE-from-the-command-line. – CrazyCoder Mar 07 '22 at 16:46
  • That worked! I was able to do "snap run intellij-idea-ultimate .". Thanks again! – skryvets Mar 07 '22 at 17:16