Monthly Archives: February 2014

3 posts

Eclipse Equinox as a Windows Service

In the Eclipse SCADA project we finally wanted to create a setup of the server components for the Windows platform. Ideally all the server tasks should be integrated into the Windows service framework, so that you can stop and start services “the Windows way”.

While there seems to be a commercial solution (64bit) from Tanuki Software, we wanted (needed) to go the open source way. Which actually brings one to Apache Commons Daemon. Since we are already using “jsvc” (the Unix way) of the library, is made sense to use “prunsrv.exe” for the Windows side.

The idea is pretty simple, you specify a class that has two static methods (start and stop) which perform the task of starting and stopping your service. The service wrapper “prunsrv.exe” will take care of loading the JVM. “start” and “stop” will be executed in the same JVM instance, so if you have a global instance variable you have no issues here. Luckily Eclipse/Equinox already has an appropriate class: EclipseStarter.

Continue reading

Creating Mac OS X Icons (icns) on Linux

Time again for some new icons for an Eclipse RCP launcher. While The Gimp can easily create XPM and Windows ICO files, when it comes to Mac OS “icns” format, you won’t have any built in support.

There are some fine tools out there for Mac OS, but if you are running Linux and don’t want to buy a Mac just for creating some icon files, png2icns comes to the rescue. It is a small command line tool which simply creates an “icns” files from some “png” files.

Create your icon files as “png” in multiple resolutions. If you are creating an Eclipse RCP launcher, you will, most likely, have them anyway for creating your Windows “ico” file. Place them in any folder you like:

-rwxr-xr-x 0 jens jens   1427 Feb 24 10:49 icon_16px.png
-rwxr-xr-x 0 jens jens   2003 Feb 24 10:49 icon_32px.png
-rwxr-xr-x 0 jens jens   2560 Feb 24 10:48 icon_48px.png
-rwxr-xr-x 0 jens jens   5304 Feb 24 10:48 icon_128px.png
-rwxr-xr-x 0 jens jens   9883 Feb 24 10:47 icon_256px.png

Ensure that you have the “png2icns” application installed. On Ubuntu it comes with the package “icnsutils”, which can simply be installed by executing:

sudo apt-get install icnsutils

Now call “png2icns”. As the man page suggest you need to provide all PNG files, that you want to be part of the icon, as argument. The first argument is the output filename. Also you can let the shell find the correct PNG file by using the wildcard (*):

png2icns icon.icns icon_*px.png

Easy! ;-)

PS: If anything goes wrong, “png2icns” will complain at the command line (e.g. due to some wrong resolution).