views:

312

answers:

1

I have written an application in Java and succesfully compiled it using gcj.

In (X)ubuntu's File Manager, my application appears with the default Linux executable icon, which I would like to replace with my own:

alt text

I have seen that other applications display a custom icon as the executable, such as Firefox, but have no idea how to approach the problem. Is there some sort of resource editor for Linux binaries?

Desktop Entry

I've tried creating a Desktop Entry file that executes the application as follows:

[Desktop Entry]
Version=1.0
Type=Application
Name=MyJavaApp
Comment=
Exec=./MyJavaApp
Path=./../../libs/
Terminal=true
Icon=./icon.png
X-KDE-Library=./../../libs/libswt.so

Double-clicking it makes a terminal pop up and disappear again, and that's it. I'm fairly sure the application doesn't launch because it can't find the required SWT library. I was hoping to see the output in the terminal, but I can't launch it from there.

Furthermore, Ubuntu doesn't seem to acknowledge Icon. I have tried various resolution PNGs; no dice.

+9  A: 

Executables on Linux do not have icons embedded (try to point your file manager to /usr/bin). What you have seen is probably a Desktop Entry. That's a text file describing the icon, program name and the executable.

Lukáš Lalinský
I'm inclined to mark this as the accepted answer as it undoubtedly is, but for some reason I'm not succeeding in getting the Desktop Entry above to either execute the application or display an icon.
Paul Lammertsma
That `Icon` entry is broken. Either use an absolute path, or use no path and let the system icon paths be searched instead.
Ignacio Vazquez-Abrams
That makes sense. Thanks!
Paul Lammertsma