Author Topic: Linux and Windows launcher-icons  (Read 1413 times)


  • Jr. Member
  • **
  • Posts: 89
  • Karma: +0/-0
    • View Profile
Linux and Windows launcher-icons
« on: Saturday 2015-September-26 04:00:45 PM »
I have a few Java games and here's how I created launcher-icons for Linux and Windows Vista.

I'll be using: for this example.

You can get the game by visiting that web site or use wget:

Code: [Select]

Here's a screen shot of the launchers on my Ubuntu desktop:

These launchers are just text files with a .desktop extension and placed on my Ubuntu desktop:
  • platformHopper.desktop
  • wobbegong 2D.desktop
  • bubbles.desktop
  • cubeCracker.desktop
  • wobbegong3D.desktop
  • wobbegongXmp.desktop

.desktop files are well described here:

A Google search for: .desktop files description

will list thousands more.

platformHopper.desktop looks like this:

Code: [Select]
[Desktop Entry]
Name=Platform Hopper
Comment=Wobbegong Platform Hopper

I'll assume you are going to base your .desktop files on platformHopper.desktop and so I'll just describe the parts you will need to change.

This text will be the text displayed under the icon on your Linux Desktop.

This text does little more than remind anyone who looks at the .desktop text what this launcher does but should be considered tool tip text.

This text is the command line that will actually launch the program. In my case, I have the full path to a file called: is a very simple executable script:

Code: [Select]
cd ~/myGames/wobbegongPlatformHopper
java -jar WobbegongPlatformHopper.jar

I'll describe and why I've created a separate script file rather than just 'java -jar etc ...' (which I could've done) in a moment.

The full path to a PNG image file, the icon that will be displayed on the Desktop., what's that for ?
Shown above, first moves the command interpreter into the wobbegongPlatformHopper directory and from there runs a java command line.

Here's a list of files in:

gameDir            (a directory) 
icon64.png         (the icon I want to show on the desktop)            (launches wobbegongPlatformHopper.jar)
lib                (a directory)

WobbegongPlatformHopper.jar requires the files located in the wobbegongPlatformHopper/lib directory to run so rather than create a separate file I could use the command line:

Code: [Select]
java -jar /pathTo/WobbegongPlatformHopper.jar -classpath /pathTo/lib

however WobbegongPlatformHopper.jar has a hardcoded reference to the directory: gameDir
and assumes it is in the same directory as: WobbegongPlatformHopper.jar

This is why I created a separate file that is launched by platformHopper.desktop

Both and the .desktop files have to be set as executable

This can be done in a few ways:

  • right click on your .desktop file
  • from the properties dialog select the Permissions tab
  • check the 'Allow execting file as program' check box


from a command line type:

Code: [Select]
chmod 755 /pathTo/your.desktop
chmod 755 /pathTo/

The .desktop file should be placed on your Linux Desktop.

Trouble shooting

if your .desktop file does not show an icon:

- the .desktop file needs to be set executable

- Exec= text needs the full path to the or the command line is not valid

  run the command line from a command prompt to make sure it works

- the Icon= text is not pointing at a .png file

  run the text from a command prompt like this:
Code: [Select]
display pathTo/yourIcon.png
  your icon will be displayed if the path is correct


In windows all you have to do is:
  • open notepad.exe

  • type the single line:

    java -jar WobbegongPlatformHopper.jar

  • save the file as: launch.bat

    for example, c:\wobbegongPlatformHopper is the game directory, where WobbegongPlatformHopper.jar resides

    so save the file to:

  • from the file manager, locate launch.bat and right click

  • select: create shortcut

    a separate file will be create called: launch.bat - Shortcut

  • drag or copy 'launch.bat - Shortcut' to your Windows desktop

Give the shorcut an icon
  • from your Desktop,  right click on: launch.bat - Shotcut

  • select: properties

  • from the Properties window, click the button: Change icon
    you are going to choose a particular .ico file

  • click Browse and navigate to c:\wobbegongPlatformHopper\
    and select: windows_icon.ico

I hope these steps get you on the road to creating launchable icons for your Linux and Windows desktops.

Sorry for the lack of Macintosh instructions but I don't have access to a Macintosh desktop.

Best regards