This is an annoying problem we sometimes face with certain applications in Ubuntu. But the solution is very simple. For the convenience, let's go step by step. (I'm facing this problem for IntelliJ IDEA.)
Step 1:
We have to create a Desktop Entry File (with .desktop extention) in ~/.local/share/applications. Desktop Entry File is a configuration file describing how a particular program is to be launched, how it appears in menus, etc.
I'm creating jetbrains-idea.desktop file.
vi ~/.local/share/applications/jetbrains-idea.desktop
Step 2:
Add following text to the file and save it.