Building JBidwatcher from git.
|
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. Requirements:
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. Install the source version of icedtea-3 ebuild (which builds icedtea-8…) by install the virtual/jdk package. Select the new java-vm for the system. As a normal user select the icedtea-8 vm. $ eselect java-vm set user 1 Build JBidwatcher from source As root, pull the latest git version of jbidwatcher. # cd /usr/src/ 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. Copy the freshly built jar file to a suitable location for execution: # cp JBidwatcher-2.99pre5.jar /opt/JBidwatcher/ 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 (https://github.com/jruby/jruby/wiki/GettingStarted): “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 https://s3.amazonaws.com/jruby.org/downloads/1.7.23/jruby-bin-1.7.23.tar.gz 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 I’m assuming you are doing a clean install of jruby, and cleaning the global variables is a good idea. 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. Cheers |
|
Greetings, 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 |
|
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. Cheers |
|
As an addition to the how-to-description of Watched2 I’d like to mention: To find out the needed paths of “export RUBYLIB=…:…:…” After trying I got JBidWatcher finally running now on Debian 8.3 Linux: current source codes from: https://github.com/cyberfox/jbidwatcher.git java 1.8.0_72 to get it running I enter: ant clean |