Intellij launcher doesn't work on unity?
Asked Answered
L

14

91

Under /usr/share/applications I created:

intellij.desktop:

#!/usr/bin/env xdg-open
[Desktop Entry]
Version=1.0
Type=Application
Terminal=false
Exec=/path/To/idea.sh"
Name[en_US]=Intellij
Name=Intellij
Icon=/path/to/intellij.png

Then I drag it to the Unity launcher bar. I click it, but nothing happens. How can I make it work?

JAVA_HOME is set correctly, other Java apps (like Eclipse) work and click idea.sh.


My configuration:

  • Ubuntu 12.10 64-bit (Desktop)
  • Oracle JDK 1.7
  • IntelliJ Community 12
Lythraceous answered 20/1, 2013 at 11:55 Comment(1)
Is there a dangling " at the end of the Exec line? Also, you're probably better served at askubuntu.com.Wohlen
H
282

You can use "tools" > "create desktop entry", in IntelliJ itself.

Hurwit answered 20/1, 2013 at 19:22 Comment(7)
Came across this. I might add: after the above you can "Lock to Launcher" as you do normally. The above simply enables it.Shellishellie
Note: if you run the IDE from the "idea.sh" script and then right click on the icon and "Lock to Launcher" before you use "create desktop entry", a bad ~/.local/share/applications/jetbrains-idea-ce.desktop "desktop entry" will be created. Since the local one overrides the one in /usr/share/applications (where the entry is placed if you say create for all users), it needs to be deleted for the icon to ever work correctly.Certificate
"Lock to launcher" after you run idea.sh from the terminal won't work: it will create a desktop entry with the full Java invocation: for some reason that doesn't work. Using the "Configuration > Create desktop launcher" from the 'splash screen' does create the right desktop entry; however, it does not sets correctly the 'x' permissions (whether for all users or just for the given user): you will have to run a chmod a+x jetbrains-idea.desktop to make it work. BTW - am I the only one to HATE the fact that now Unity does not let you right-click edit the launcher icons?Eupepsia
@JamesCaccese's comment helped resolve my issue. But in my computer, I deleted ~/.local/share/applications/jetbrains-idea.desktop file, since there wasn't a jetbrains-idea-ce.desktop file.Endearment
Amazing! Love Idea because they care even for this small things! Works well on 14.10Goof
Does not work in Ubuntu 21.04. Creates the .desktop file but the launcher icon does not appear.Plexiglas
I didn't have a Tools menu, and had to click on the "settings cog" to access this option.Singlephase
H
25
  1. Open a terminal, in /path/idea/bin folder
  2. Start IntelliJ with ./idea.sh
  3. Tools -> Generate Desktop Entry
  4. Close IntelliJ
  5. In the terminal, start nautilus as admin (gksudo nautilus)
  6. Go to /usr/share/applications
  7. Drag the new icon for IntelliJ to your launcher
Hartle answered 13/2, 2015 at 5:21 Comment(1)
Step 3 should have generated a shortcut on Desktop? I can't see it, instead I have a launcher from search with Win key (I don't know if it was there previously before Generating it from Idea. So, at step 7 I don't have anything to drag in applications folder. Anyway, I've search it once, lock it to Launcher and now it's as I was expected :) Thanks!Bernardobernarr
E
11

event with create desktop entry there still an error, because the launcher is not reading JDK_HOME configuration.

so after creating the desktop entry , right click on the launcher and select properties then add bash -i before double quote in command input text exp :command [ bash -i " /home/me/ides/idea/bin/idea.sh" %f ]

Ectosarc answered 18/8, 2013 at 14:30 Comment(1)
this was my problem, thanks a lot!! I use to change my java version and i couldn't start idea by clicking the iconEshman
R
11

For starting IntelliJ IDEA from launcher
1. Create an idea.desktop file and include the following in it.

    [Desktop Entry]
    Name=IntelliJ IDEA
    Comment=IntelliJ IDEA IDE
    Exec=/{installation directory}/idea-IC-129.713/bin/idea.sh
    Icon=/{installation directory}/idea-IC-129.713/bin/idea.png
    Terminal=false
    StartupNotify=true
    Type=Application
    Categories=Development;IDE;


2. Add permission file to be executable (right click on file in permissions tab and check the execute permission) [or sudo chmod +x idea.desktop]
3. Copy that file to /usr/share/applications (in the command line, do sudo cp idea.desktop /usr/share/applications)
4. Copy that file to ~/.local/share/applications (command line, sudo cp idea.desktop ~/.local/share/applications)

Now check in dash.

Returnable answered 3/10, 2013 at 19:5 Comment(0)
D
6

I normally just create a runner under the normal menu (right click on start menu and choose edit) that points to something like bash -i ~/bin/idea/bin/idea.sh

I use bash -i to have it read .bashrc where I have JAVA_HOME set up correctly. That works like any other program.

bin/idea is always a link to the latest version so I never have to recreate this start menu item.

Desinence answered 20/1, 2013 at 19:26 Comment(1)
Start menu? Doesn't sound like you're using Unity.Chamade
R
5

For new installation, create desktop entry from: Tools > Create Desktop Entry

If you are upgrading IntelliJ to a new version do the following:

ll ~/.local/share/applications | grep idea

You should see these two files

-rw------- 1 user user  315 Mar 28 17:06 jetbrains-idea-ce.desktop
-rw-rw-r-- 1 user user  311 Mar 28 17:06 jetbrains-idea.desktop

Open both files and update newly installed IntelliJ path in both of them

[Desktop Entry]
  Version=1.0
  Type=Application
  Name=IntelliJ IDEA Community Edition
  Icon=/home/user/Downloads/idea-IU-181.4203.550/bin/idea.png
  Exec="/home/user/Downloads/idea-IU-181.4203.550/bin/idea.sh" %f
  Comment=The Drive to Develop
  Categories=Development;IDE;
  Terminal=false
  StartupWMClass=jetbrains-idea-ce
Reign answered 28/3, 2018 at 11:57 Comment(0)
C
5

I just came across this and I want to add to the answer something for people who may need it.

You can use "tools" > "create desktop entry", in IntelliJ

like in this picture: enter image description here if you open intellij the first time you should create a new project to do this. it took me a while to figure that out

Chisolm answered 4/2, 2021 at 15:39 Comment(0)
J
2

On my machine running Ubuntu 17.10 and having Intellij installed using snap i couldn't find any Create Desktop Entry option.

As it turned out, i had to copy the .desktop file from /var/lib/snapd/desktop/applications to .local/share/applications.

Judicial answered 13/1, 2018 at 19:43 Comment(0)
C
1

create file jetbrains-datagrip.desktop

sudo gedit /usr/share/applications/jetbrains-datagrip.desktop

[Desktop Entry]
Version=1.0
Type=Application
Name=DataGrip
Icon=/home/gilcierweb/DataGrip/bin/product.png
Exec="/home/gilcierweb/DataGrip/bin/datagrip.sh" %f
Comment=Develop with pleasure!
Categories=Development;IDE;
Terminal=false
StartupWMClass=jetbrains-datagrip
Cycling answered 22/6, 2016 at 0:13 Comment(0)
D
1

Just posting in case some other people come across this issue.

For me all I had to do right click the entry and go to properties and in the Application tab under Work path I put the full path to the bin folder.

For example /home/teodorvecerdi/Development/idea-IU-172.3317.76/bin/.

Downhearted answered 27/7, 2017 at 20:52 Comment(0)
E
1

intellij "Menu" -> "tools" -> "create desktop entry"

enter image description here

Check icon in show apps.

Ens answered 18/5 at 14:53 Comment(0)
H
0

Another alternative:

  1. cd /bin
  2. ln -s <path to idea.sh> idea - now it is available in the dash under "idea"
  3. open dash, type idea and start IntelliJ
  4. right click on the icon in the sidebar and add it to the starter
Highup answered 25/5, 2015 at 20:59 Comment(0)
R
0

In order to have just one IntelliJ icon on the Launcher you need to add following line to your idea .desktop file:

StartupWMClass=jetbrains-idea

My working sample idea.desktop file looks like:

[Desktop Entry]
Type=Application
Terminal=false
Name=Idea13
Icon=/usr/local/bin/idea13/bin/idea.png
Exec=/usr/local/bin/idea13/bin/idea.sh
StartupWMClass=jetbrains-idea
Rubberize answered 17/6, 2015 at 6:19 Comment(0)
D
0

For Ubuntu users,

This can be due to a change to the location of idea.sh file.

As a first step, you can just run the idea.sh file and make sure it's working as expected.

In the application launcher it typically has a ".desktop" file extension and contains information about the application(it's name, icon, command to run the application, and other metadata).

In Ubuntu operating system, the location ~/.local/share/applications typically points to a directory in a user's home folder that contains desktop application launchers or shortcuts. You should find the .desktop file for JIdea in the same location.

Check and confirm the paths for the Exec is correct (and Icon if it's applicable). If it's not correct it and that should do the trick.

[Desktop Entry]
Version=1.0
Type=Application
Name=IntelliJ IDEA Ultimate Edition
Icon=/home/user/Software/ideaIU-2020.3/idea-IU-203/bin/idea.svg
Exec="/home/user/Software/ideaIU-2020.3/idea-IU-203/bin/idea.sh" %f
Comment=Capable and Ergonomic IDE for JVM
Categories=Development;IDE;
Terminal=false
StartupWMClass=jetbrains-idea
StartupNotify=true

If this file is not there, you can create a fresh one as well. Just copy the above content and make sure the paths are correct

Dashpot answered 23/7, 2023 at 17:11 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.