Install Freerouting on Ubuntu 14.04 – 16.04

Introduction

Freerouting was a web application created and maintained by Alfons Wirtz at his website, here.  It allowed us to import a design file from kicad and then auto-route the project based on some design preferences.  It was basically a free auto-router for kicad.  Hence the name!

For “various reasons” the author has decided to drop the project, and it is no longer available as a web application at his site.  However, he has been kind enough to open-source the project and he encourages users to run it as a local application.

There are some wikibooks instructions for installation of the Freerouting application here.  I have recently attempted to follow these instructions, but there are some stumbling-blocks which prevented me from being able to run a working application.  I believe these same stumbling blocks will face lots of people; at least those who decide to install it on a recent Ubuntu variant.

This blog will detail all of the instruction steps necessary to run a working local copy of Freerouting.  My instructions are based on those at Wikibooks, but with some extra steps to get around the stumbling blocks.

The Pre-Requisites

You can skip this part if you already have installed a recent version of:

  1. Git
  2. Java JDK
  3. Netbeans

Otherwise, read on!

Installation of Git

Use your package manager, as follows:

sudo apt-get install git

Installation of Java JDK & Netbeans

This post used to direct you to install the JDK and Netbeans packages separately, but all of a sudden this method stopped working.  When I queried it with the Netbeans team they refused to admit any problem, but suggested the “combined package” instead.  Well, I don’t agree there isn’t a problem but the combined package does work so let’s do that instead!

First you need to locate the JDK & Netbeans combined package.  At the time of writing this post, you can get it here.

Once you’ve downloaded it, you need to make sure that you have permissions to execute it.  To do that, ‘cd’ to the directory where you downloaded the installer, and then type the following command, substituting for your version of netbeans if it’s different from mine:

chmod u+x jdk-8u111-nb-8_2-linux-x64.sh

Then execute the installer:

./jdk-8u111-nb-8_2-linux-x64.sh

You should see a screen something like this:

JDK & Netbeans Combined Installer
JDK & Netbeans Combined Installer

Walk through the installer dialogue to completion.

Installation of Freerouting Dependancies

The freerouting application depends on a couple of things to work.  It requires jh.jar and netx.jar.  To get those, install the following:

sudo apt-get install javahelp2 icedtea-netx-common

Installing FreeRouting & Running in NetBeans

Downloading FreeRouting

Now you need to download freerouting.  It’s available on github, so you just need to ‘cd’ to a directory where you want to download the project, and then enter the following command:

git clone https://github.com/nikropht/FreeRouting

Loading FreeRouting into NetBeans, Compiling and Running

Now you need to start netbeans (should be under ‘Development’ in the application launcher) and import the FreeRouting project.

  1. With netbeans open, select File -> New Project or use the keyboard shortcut CTRL-SHIFT-N.
  2. In the Categories window, select ‘Java’.  In the Projects window, select ‘Java Project with Existing Sources’.
    Select Next.
  3. Give your project a name.  e.g. FreeRouter, and choose a path.  e.g. $HOME/programming/netbeans_projects/
    Select Next.
  4. In the Source Package Folders area, select Add Folder and browse to the place where you downloaded the FreeRouting sourcecode from git.
    Select Finish.  Netbeans will create the project.
  5. Select File->Project Properties.
    In the categories area, select Libraries.  Then, with the compile tab displayed in the area on the right, select ‘Add JAR/Folder’.  Browse to and choose /usr/share/java/jh.jar.
  6. This next part is not explained in the wikibooks instructions I linked to at the beginning of the post.  But it is absolutely necessary in order for FreeRouting to work.  While still in the Libraries area, Select ‘Add JAR/Folder’ again.  Now browse to /usr/share/icedtea-web/netx.jar.
  7. Now, contrary to the instructions in the wikibooks link, we are NOT going to use Web Start:
    While still in project properties (File->Project Properties), select from the categories area, underneath Application, ‘Web Start’.   Make sure this check box is NOT enabled.  Then Select ‘Run’ from the categories area and make sure the Configuration pull down menu is set to <default config>
    Select OK to exit Project Properties.
  8. Now from the netbeans main menu, choose Run and select “clean and build project”.  If all has gone well, it will conclude with “BUILD SUCCESSFUL”.  Now you can run the application: select the green triangle or press F6 to run the project.  You should see the following:

Freerouter_004

Success!

Now you just need to learn how to use Freerouter! I got it routing a PCB pretty quickly without instructions so I think it is pretty intuitive to run.  However, it may not be so intuitive to choose all the correct options for your PCB.  That’s for another post, maybe.