App icon logo not displaying during app opening

Hi I have a weird problem. When I open Eclipse, the app icon runs without image at first, but after it executes completely, it then moves back to to it’s original place in dock. In the past I had to create an entry in the below folder to make it not open as a separate icon, but I am not able to get rid of this problem. As this is a manual install, Is there any other entry I have to maintain other than below? Thanks you..

~/.local/share/applications/${APP_NAME}.desktop

I maintained that, so it works fine aftere executing the app. However, this happens only during execution

--- /usr/local/share/applications/eclipse.desktop.old
+++ /usr/local/share/applications/eclipse.desktop
@@ -10 +10 @@
-StartupWMClass=Eclipse
+StartupWMClass=java

Thank you, this works 100%