Experiments with ruby-processing (processing-2.2.1) and JRubyArt for processing-3.0

Wednesday, 10 April 2013

A simple install of jruby on linux for individual users

You absolutely should not install jruby supplied by your distribution (well at least not if it is debian based, actually ArchLinux version is OK) it will be hopelessly out of date and you will probably have no control over java version used.
OK you don't want anything too complicated so why not just unzip the tar file in your home directory (or possibly in /opt). So now you have folder jruby-1.7.4 with a sub folder bin. So now all you need to add that bin to your PATH in your .bashrc, then source .bashrc to update. Now when you type 'which jruby' it should point to the ~/jruby-1.7.4/bin/jruby
Actually in practice it is probably more convenient to create a symbolic link to say /usr/local/bin/jruby. I found rvm to be a real pig and probably over complicated, but that or brew may be way to go on the Mac? Actually I'm warming the idea of creating my own jruby script, in which I can set the java version and export JAVA_HOME and JRUBY_HOME also could set 'global' jruby args such as invoke-dynamic, see below (it is unfortunate the way -J--XX command gets split over two lines here).
#!/usr/bin/env bash
export RUBYOPT=rubygems
export JAVA_HOME=/opt/jdk1.7.0_40
export JRUBY_HOME=/opt/jruby-1.7.4
${JRUBY_HOME}/bin/jruby -J-XX:CompileCommand=dontinline,org.jruby.runtime.invokedynamic.InvokeDynamicSupport::invocationFallback $@

For installing gems using jgem or jruby -S gem you migh want to take a look at this .bashrc file I use on Archlinux (for ubuntu gems are /var/lib/gems/etc)

No comments:

Post a Comment


Blog Archive

About Me

My photo
I have developed JRubyArt and propane new versions of ruby-processing for JRuby- and processing-3.2.2