Installing java and browser plugin

I’ve spend some time today trying to figure out how to enable the chromium browser to run the latest version of sun..erh, oracle java. Apparently chromium reads the .mozilla/plugins folder… This i how I got things to work

Installing java

Download a java 7 without an installer from java.com. Untar this in /usr/local

# cd /usr/local
# sudo tar xzf ~/Downloads/jre-7u13-linux-x64.tar.gz

And update alternatives:

# sudo update-alternatives --install /usr/bin/java "java" /usr/local/jre1.7.0_13/bin/java 1062
# update-alternatives --config java

Install the Firefox Plugin

# mkdir -vp ~/.mozilla/plugins

32-Bit version:

# ln -s /usr/local/jre1.7.0_13/lib/i386/libnpjp2.so ~/.mozilla/plugins/

64-Bit version:

# n -s /usr/local/jre1.7.0_13/lib/amd64/libnpjp2.so ~/.mozilla/plugins/

Installing cucumber and jruby

Yet another note for myself…

At work I run Linux Mint 12 on my workstation and needed to install cucumber on top of jruby. The reason for choosing jruby is another story.

At first I tried to do with the pre-build packages for Mint, but did not have any luck. Then Frank told me to use rvm (Ruby Version Manager), and that was a good advice. It took me less than 10 minutes to get up and running. This was what I did:

To install rvm (Ruby Version Manager):

# curl -L https://get.rvm.io | bash -s stable --ruby

The installation adds this line to .bash_login:

# [[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"

On my system, bash only reads .bashrc on login – not .bash_login – so I had to choose one of the following solutions. Since my .bash_login originally was empty, thus only had the stuff that rvm added, and I since I’m a lazy bastard I did this.

# echo ~/.bash_login >> ~/.bashrc

Which is basically the same as:

# echo '[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"' >> ~/.bashrc

But I guess you just as well can include .bash_profile in .bash_rc like this

# echo 'source ~/.bash_login' >> ~/.bashrc

Now you can install jruby using rvm:

# rvm install jruby

Set jruby to be the active ruby

# rvm use jruby

Now Install cucumber using jruby’s gem

# gem install cucumber

And I was ready to go…

Upgrading Groovy

This post is mainly a note to my self. At work I use a Linux Mint distro, but the bundled version of groovy is 1.7.10 and I needed some stuff only present in 2.0.0, thus I had to upgrade. I’m not that into linux (or any other OS for that matter), so it took me a while to figure out how. Then my computer crashed and I had to do it over, but I had not made any notes during my previous attempt. Luckily Google was my friend and I was able to find out quite quickly. This will be my notes now:

First download groovy 2.0.0 from http://groovy.codehaus.org/Download

Then, in a command prompt, execute the following

# cd /usr/lib/
# sudo unzip /groovy-binary-2.0.0.zip
# sudo update-alternatives --install "/usr/bin/groovy" "groovy" "/usr/lib/groovy-2.0.0/bin/groovy" 1
# sudo update-alternatives --install "/usr/bin/groovyc" "groovyc" "/usr/lib/groovy-2.0.0/bin/groovyc" 1
# sudo update-alternatives --install "/usr/bin/groovyConsole" "groovyConsole" "/usr/lib/groovy-2.0.0/bin/groovyConsole" 1
# sudo update-alternatives --install "/usr/bin/groovysh" "groovysh" "/usr/lib/groovy-2.0.0/bin/groovysh" 1
# sudo update-alternatives --install "/usr/bin/java2groovy" "java2groovy" "/usr/lib/groovy-2.0.0/bin/java2groovy" 1
# sudo update-alternatives --config groovy

Test that everything went well

# groovy -v
Groovy Version: 2.0.0 JVM: 1.6.0_26 Vendor: Sun Microsystems Inc. OS: Linux

(use google for details about “sudo” and “update-alternatives”)