Get Civilisation running under Linux

This article describes the steps that you must take to get Sid Meier’s Civilisation running on Ubuntu (Hard Heron). So now I have to clear some things up:

  1. I know that Ubuntu is not Linux, but the process for other distros should be similar enough.
  2. We are talking about the Sid Meier’s civilisation game from 1991


„Get Civilisation running under Linux“ weiterlesen

In Three steps to your Java Emitter template

Creating a Java Emitter Template (JET) is no easy feat, but if you have the right infrastructure set up it’s not that difficult.
This article is based on the Java Code Generator plug-in for Eclipse.
„In Three steps to your Java Emitter template“ weiterlesen

Wrongfully assigned IP address

If you have no internet connection that may have many causes. I recently had a wrongfully assigned IP address. The computer accesses the internet through a router that assigns an IP address form 192.168.1.0/24 address range.
The first thing if the connection to the internet fails is to check the connection to the router with a ping. In my case this failed. Executing the ifconfig showed why:
ifconfig -a
The assigned IP was not in the defined range by the router. In fact it was a public IP (this might be a sign that someone unauthorised tried to gain access). It seems the IP was defined static since a restart of the system or the router had no effect.
Here is the solution:
sudo ifconfig eth0 down
sudo ifconfig eth0 up

eth0 is the network interface with the wrong IP. If you are on another distribution than Ubuntu you may not need the sudo to bring the interface down and up again.

How to debug a Java Emitter template

This is a tricky task. The generation of a piece of code – let’s assume that it is a Java class – is based on a java emitter template that defines with literal constants and JSP like syntax the code of the resulting class. To create a source file a Java generator class is generated from the template. This generator class produces dour output Java source file.
„How to debug a Java Emitter template“ weiterlesen

Define access restriction on plugin

In Eclipse it seems to be common practice to define interfaces and hide a concrete implementation in a package under *.internal.*. The actual hiding though is not result of the word „internal“ in the package name but must be specified in the MANIFEST.MF with the exported packages.
There are also further possibilities that can be engaged. For example you can define a package a friend to another package(es) so that only these can access the classes within.

Manifest.MF
Bundle-SymbolicName: example
Export-Package:
com.example.public, // Anyone can access com.example.public if imported
com.example.test;x-internal:=true, // This is marked as internal, but can be used
com.example.impl;x-friends:=com.example.other, // Only com.example.other should access it

This is not part of the OSGi Standard but the Equinox reference implementation.
For further reference see the Article at EclipseZone.