If it is in Ubuntu, this is how to fixed it. This is a permission problem.
Option fix 1. locate your eclipse installation file and run from terminal
sudo ./eclipse
Option fix 2. create a file named eclipse.desktop using gedit on your desktop and add the following
[Desktop Entry]
Type=Application
Name=Eclipse
Comment=Eclipse Integrated Development Environment
Icon=/opt/eclipse/icon.xpm
Exec=sudo /opt/eclipse/eclipse
Terminal=true
Categories=Development;IDE;Java;
StartupWMClass=Eclipse
Right click and click Allow Launching. This will open terminal and will ask for the sudo password and run eclipse. Then, you need to add this file to the launcher. Open the launcher with the following command.
xdg-open ~/.local/share/applications
drag and drop the eclipse.desktop in the launcher folder. if it doesn't let you you might have to run it as sudo. Adding it to the launcher will allow you to search eclipse within the apps.
Option Fix 3.
Do fix 2 plus you will have to modify the sudoers file and add your username (CAREFUL YOU CAN LOSE ACCESS TO YOUR COMPUTER) if you do this you can change Terminal=true to false. This will make eclipse open without going to terminal and execute normally. If you are brave to modify sudoers file add at the END of the file.
username ALL=(ALL:ALL) NOPASSWD:ALL