0

I referred this link for my problem: How to create launcher icon

Though my matlab icon is already created, whenever I click it this shows up for a few seconds:

Matlab splash screen appearing temporarily

Then, the application closes itself automatically!

I have to run it from the terminal every time for MATLAB to actually open and go beyond the splash screen:

/usr/local/MATLAB/R2017a/bin/matlab

Though the above method works perfectly, I want to be able to run it properly from the icon, I can't seem to figure out what the problem is.

As mentioned in the link above, of the top voted answer I did this first:

sudo ln /usr/share/app-install/desktop/matlab-support:matlab.desktop /usr/share/applications/matlab.desktop

Then deleted all the contents of the .matlab file and replaced it with:

[Desktop Entry]
X-AppInstall-Package=matlab-support
X-AppInstall-Popcon=4
X-AppInstall-Section=multiverse

Version=1.0
Type=Application
Terminal=false
Exec=/usr/local/MATLAB/R2017a/bin/matlab -desktop
Name=MATLAB
Icon=/usr/share/app-install/icons/_usr_share_icons_hicolor_48x48_apps_matlab.png
Categories=Development;Math;Science
Comment=Scientific computing environment
StartupNotify=true
StartupWMClass=com-mathworks-util-PostVMInit

X-Ubuntu-Gettext-Domain=app-install-data

When I retry doing the first step, I get the following message:

ln: failed to create hard link '/usr/share/applications/matlab.desktop': File exists

Then I tried creating a soft-link as suggested in one of the answers:

ln -s /usr/local/MATLAB/R2017a/bin/matlab /usr/local/bin/matlab

Nothing seems to work for me, help!

1

There are 2 problems with your approach.

  1. you use hardlink instead of symlink explained here
  2. you switched target and link paths. It should be sudo ln -s pathToLink pathToTarget

So this is the corrected command:

sudo ln -s /usr/share/applications/matlab.desktop /usr/share/app-install/desktop/matlab-support:matlab.desktop

  • I copied and ran the exact corrected command that you suggested, but it gave me a similar message: ln: failed to create symbolic link '/usr/share/app-install/desktop/matlab-support:matlab.desktop': File exists – Kewal Shah Jan 13 '18 at 1:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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