Building JBidwatcher from git.

Subscribe to Building JBidwatcher from git. 4 post(s), 3 voice(s)

Avatar Watched2 3 post(s)

Hi all,

There are a few posts asking how to compile JBidwatcher from source. For example:

Requirements for compiling recent Master branch

Tips on compiling JBidwatcher?

I had not run jbidwatcher for a long long time on my Gentoo Linux distribution due to errors. However, I thought I’ll try to compile from source to see if the errors went away. After many weeks of on/off debugging to get it to work on a Gentoo Linux distribution, I’ve written up a rough guide on how to compile JBidwatcher from git.

This guide is for installing JBidwatcher in the Gentoo linux distribution.


  1. Java SDK 1.8
  2. Ant
  3. JRuby + plus some other packages.

Install ant for building JBid

As root, emerge ant:

# emerge ant-core

Check the installed java environment with ant.

# ant -diagnostics

Java SDK version 1.8

Stable Gentoo does not have the latest Icedtea 3 (Java 1.8) so I had to install the java overlay using layman. The details of which are outside the scope of this guide. However, you’ll need to unmask the latest ebuilds provided by the Java overlay.

Yes, I could have install the official Sun JavaSDK, but I’d prefer to use the free-software version of java.

If you don’t have a java sdk yet, install the bin version first.

# emerge -v icedtea-bin

Remove icedtea-web package due to the version conflict with the newer icedtea you are about to install.
# emerge -C icedtea-web

Install the source version of icedtea-3 ebuild (which builds icedtea-8…) by install the virtual/jdk package.
# emerge -vp jdk

Select the new java-vm for the system.
# eselect java-vm set system 1

As a normal user select the icedtea-8 vm.

$ eselect java-vm set user 1
$ eselect java-vm show
Current system-vm
Current user-vm

Build JBidwatcher from source

As root, pull the latest git version of jbidwatcher.

# cd /usr/src/
# git clone
# cd jbidwatcher
# ant clean
# ant

Ignore the error about Launch4j as this is used to create a windows EXE, but this is a linux system and we only need the jar file.
(See “Builds, Launch4J”

Copy the freshly built jar file to a suitable location for execution:

# cp JBidwatcher-2.99pre5.jar /opt/JBidwatcher/
# cd /opt/JBidwatcher/
# ln -s JBidwatcher-2.99pre5.jar JBidwatcher.jar

Running JBidwatcher

Jbidwatcher needs JRuby. From trial and error, JBidwatcher needs the a later version of JRuby than the version Gentoo has available. The background to the Gentoo/JRuby issue can be found here:

Hence, I installed the latest 1.7 series JRuby locally. It’s advised that jruby is installed from source and not a version package management system like RVM. Which I did originally and had other issues finding packages. As stated below (

“On Linux and Mac, you can either install the JRuby binaries or use a Ruby version manager such as RVM. However, it’s best to avoid using a package manager because of issues with keeping the downloaded versions current. If you prefer to build your own JRuby, see Downloading JRuby Source and Building It Yourself.”

As a normal user you can execute the following commands to install JRuby locally:

$ wget
$ tar -vxf jruby-bin-1.7.23.tar.gz
$ mv jruby-1.7.23/ ~/opt/
$ cd ~/opt/
ln -s jruby-1.7.23 jruby

In your .bashrc add the following path so the JRuby executable can be found:

export PATH=“${HOME}/opt/jruby/bin/:${PATH}” # Add jruby to PATH

You will also need to install the following jruby packages:

$ jruby -S gem install activesupport
$ jruby -S gem install logger
$ jruby -S gem install activerecord-jdbcderby-adapter

I’m assuming you are doing a clean install of jruby, and cleaning the global variables is a good idea.
$ unset RUBYLIB
$ unset GEM_PATH
$ unset GEM_HOME
$ unset IRBRC

For the source compiled JBidwatcher to work, you will need to set the RUBYLIB path with all the jruby packages it uses. After a lot of trial and error by running JBid and finding each missing package and adding it to the RUBYLIB cycle, I got this:

$ export RUBYLIB=“${HOME}/opt/jruby/lib/ruby/shared/:\

Now a normal user can run JBidwatcher by executing the following command:

$ java -jar -Xms256m -Xmx512m /opt/JBidwatcher/JBidwatcher.jar

Hopefully, the JB application will start up and happy snipping.

I hope this helps and please add any other suggestions, corrections or tips.


Avatar Morgan Schweers Administrator 1,204 post(s)

Wow! That’s a great write-up, and I appreciate it a lot!

I have to note, as a bit of caution, that I don’t support the IcedTea version of Java. Historically it’s been notoriously buggy, mostly in UI code that the majority of server-side Java devs don’t care about (and thus gets fewer eyes in an open source project). I don’t know what 8 is like, but it’s been a problem for me in the past.

JBidwatcher’s source tree does come with its own version of JRuby, and all those gems are packaged with it in the lib/jbidwatcher directory. Some in gems.jar, others expanded in the file system.

The amount of work that went into you putting that together is amazing, and I can’t thank you enough!

— Morgan

Avatar Watched2 3 post(s)

Hi Morgan,

Sorry for the late reply, been flat out with work and then a much needed holiday.

It’s we the users who should be grateful for the years of work you have put into Jbid. Countless people around the world sacrifice time with family, friends, opportunities or any number of things for others to create free-software for the freedom of users. They should be supported and thanked, and it’s not really recognised in society as much as it should.

As you can tell, I’m not a jruby expert and missed the obvious gems.jar in the lib directory. I’ll have a think about how it can be done more elegantly for linux users.

However, in the mean time I hope this helps others start testing or developing the software.


Avatar Hartmut 3 post(s)

As an addition to the how-to-description of Watched2 I’d like to mention:

To find out the needed paths of “export RUBYLIB=…:…:…”
You can use do e.g.
gem which rubygems
gem which monitor
gem which …
and so forth.

After trying I got JBidWatcher finally running now on Debian 8.3 Linux:

current source codes from:
git clone

java 1.8.0_72
rvm 1.26.11 (latest)
jruby 1.5.6 (ruby 1.8.7 patchlevel 249)

to get it running I enter:

ant clean
ant linux
export RUBYLIB=“$HOME/.rvm/rubies/jruby-1.7.19/lib/ruby/shared:$HOME/.rvm/rubies/jruby-1.7.19/lib/ruby/1.9”
java -jar JBidwatcher-2.99pre5.jar