Installing Fedora 3 on Windows

This is a record of my attempt to install Fedora 3 on Windows

1. Install JDK 6. Can be downloaded from:

1.1 In order to prevent spacing problem in the directory name, I chose to install Java at C:\Java (Normally, it goes to C:\Program Files\Java

2. Install fedora 2. It can be downloaded from:

2.1 Navigate to folder in Command Prompt (cmd.exe). I ran the Command Prompt as Administrator by right click > Run as Administrator. Then I run

java -jar fedora-installer.jar

2.2 I selected custom and parameters [roughly] can be found here.

3. Setting Environment Variables. This can be done in 2 ways.

3.1 Right click at My Computer > Properties >Advanced >Environment Variable

3.2 Through command (only for that session)



SET CATALINA_HOME=C:\fedora\tomcat

3.3 Navigate to FEDORA_HOME\tomcat\bin

3.4 Run startup.bat

Please find your fedora at the url, for example, http://localhost:8080/fedora

Ps. It also works when setting up java to C:\Program files\Java\…

Pss. Everything seems to work fine, there must be something wrong with my installer lol

Installing The Fascinator on Ubuntu 9.04

Today I attempted to install the Fascinator on Ubuntu 9.04.

The Fascinator is a software platform for eResearch. Development started in 2008 as an attempt to create a clean and usable Institutional Repository user interface.


I first get the documentation from:

To install,

1. I download the file from the server.

2. Then I made it executable by running chmod a+x

3. Run the installer: sudo ./

4. The installer will ask for install directory, passwords, and proxy.

Then I leave it running, while getting a coffee 🙂

When I came back, I have the fascinator running. It’s so good!

Subclipse 1.6 Update to HEAD VS Update to Version…

Today I updated my eclipse to use subclipse version 1.6. When I go to Team, there are 2 update functions: update to head and update to version.

According to a release note:

Update has been renamed to Update to HEAD

Update to version has been added


Microsoft Office Save as PDF

I found Microsoft Office PDF plugin awhile ago. It’s called “Microsoft Save as PDF or XPS.”

This plugin can be downloaded from Microsoft Download Centre site:

Enjoy 🙂

Escaping HTML in Java

Today I was looking around for ways to escape HTML in java, similar to htmlspecialchars() in PHP.

I found this Lang package:

To use it:

1. Download the jar file and put it with other libraries in lib

2. Import “org.apache.commons.lang.StringEscapeUtils;”

3. StringEscapeUtils.escapeHtml(myString);

API/Documentation can be found here:

Fedora add datastream Exception

Today, when I deployed my application on a production server and tested it, I received this exception:

fedora.server.errors.GeneralException: Unable to add or modify object (commit canceled)

This is caused by fedora.API-M.addDatastream() method. It turned out that the issue is because I used null value for an alternateid, instead of an empty array of string. This is quite strange because everything works fine on my development machine. Anyway, this is the correct syntax.

apim.addDatastream(“changeme:1”, “DsId”, new String[] {}, …);


apim.addDatastream(“changeme:1”, “DsId”, null, …);

Source: [1], [2].

Casting Array in Java

Casting an array directly throw ClassCastException. This is how I get around it.


import java.util.ArrayList;

ArrayList<MyObject> tmp = new ArrayList<MyObject>();

// insert data in to tmp

// this will prompt and ask for casting

MyObject[] tmpArray = tmp.toArray();

// this will throw ClassCastException

MyObject[] tmpArray (MyObject[]) tmp.toArray();

Why? Because toArray() returns a type of Object[] and it requires type casting.


MyObject[] tmpArray (MyObject[]) tmp.toArray(new MyObject[tmp.size()]);

I guess it should be the same for other dynamic list types.