I wrote an article a while back showing you how to get started with Tortoise Git and and Cygwin on Windows.
It seems that people are starting to favor msysgit now since it is much more lightweight than the Cygwin route and Github recommends it.
The installation process for msysgit is extremely straightforward and an older tutorial is already available on Github. However, I figured that it would be a good idea to have an updated installation tutorial available to all the new gitters out there.
These are the installation options I used to install Git-1.7.0.2-preview20100309.exe on Windows.
Note: You can enable the options to show a Git GUI or Bash shell if you want that option to be available every time you right-click on something in Windows Explorer. I just didn’t want that much space taken up on my right-click menu.
And, that’s it! Now you have Git installed on your Windows machine and can create your first Git repository or install Tortoise Git. Happy version controlling.
Now that the hard parts are finished, all that’s left is to run our bundle in the Knopflerfish Desktop.
Click File -> Open Bundle File (Ctrl+O) and select the bundle we created in Part 2 (the default is:
/out). Note, the bundle .jar file gets built automatically through Eclipse.
Once the bundle has been loaded into the Knopflerfish OSGi Desktop simply hit the Start Bundle button and watch it go!
And that’s it! You have just created your very first OSGi bundle using Eclipse and Knopflerfish. The RandomRoll application is probably one of the lamest apps around, so go and make something awesome and send me a comment when you do.
This is Part 3 of a 3 part introduction to OSGi and Knopflerfish.
SOA OSGi Development with Knopflerfish – Part 1: The Setup
SOA OSGi Development with Knopflerfish – Part 2: The Code
SOA OSGi Development with Knopflerfish – Part 3: The Execution
Now that we have Eclipse and Knopflerfish installed let’s get into some code. This OSGi bundle will roll a random six-sided die every second and print the result to the Knopflerfish Desktop console.
Click File -> New Project and select OSGi Bundle
Fill in the project information, I am going to call this project RandomRoll.
This is the OSGi specific information, make sure you check the “Create Activator” class box (More on this later.)
The manifest file contains all of the OSGi required information for your bundle. The Eclipse OSGi plugin has a built-in editor for the bundle.manifest file to make editing it a little easier on you.
Your default bundle.manifest file should look like this.
Manifest-Version: 1.0 Bundle-Name: RandomRoll Bundle-Description: Roll a die every second Bundle-Activator: RandomRoll.Activator Import-Package: org.osgi.framework Bundle-Vendor: Tutorial Bundle-ManifestVersion: 2 Bundle-SymbolicName: RandomRoll Bundle-Version: 1.0.0
This is where the logic of our OSGi application lies. We’ll treat the RandomRoll class just like any other class. The only OSGi requirement is that RandomRoll must extend java.lang.Thread.
package RandomRoll;
import java.util.Random;
public class RandomRoll extends Thread {
private boolean running = true;
public RandomRoll() {
The OSGi framework allows Java developers to create a dynamic component model for their applications. Developers create “bundles” that can be deployed and executed remotely and provide distributed services. The OSGi Framework can act as a Install New Software
Next, click the “Add” button and add the Knopflerfish update site: http://www.knopflerfish.org/eclipse-update/
Once the update site has been added, you should automatically see an option for the Knopflerfish plugin. Check the box and hit “Next” to install. Read the license terms and complete the installation.
Now, we can create OSGi Projects (More on that later)
Download the latest stable release from the Knopflerfish website. I will be using the complete framework version 2.3.3 for this tutorial.
Now, we need to install the Knopflerfish framework:
java –jar knopflerfish_osgi_.jar
This will open up an installation wizard which will let you set an installation directory.
Finally, we need to run Knopflerfish:
java –jar framework.jar
You should now see the Knopflerfish OSGi Desktop. This is where we will register our bundles and execute them.
Now we’re finally ready to write our first bundle, time to move on to Part 2.
This is Part 3 of a… Read the rest