Setting up Sun JRE 6 and Ruby 1.8 onto a computer without root privileges

Posted by tudor 0 comments

In the past weeks I have been working on a distributed database management system, and have run into the difficulties of running certain tools (such as JVM or Ruby) from within a cluster of computers, without having root/su on the cluster machines.

Installing JVM and Ruby on a linux machine on which you only have rights in your home folder may be tricky.

Below I post a few hints on how I managed to have Sun’s JRE and Ruby running.

Sun’s JRE

First I installed the JVM from Sun onto a machine on which I have root privileges (running Ubuntu). At this point, you should get a folder like /usr/lib/jvm/java-6-sun/jre/ on your local machine which contains Sun’s latest JRE.

For deploying the JVM onto a cluster machine all you need to do is create a folder on the cluster machine in your home directory like ~/tools/java/ and copy the content of the local JRE installation (/usr/lib/jvm/java-6-sun/jre/) there.

Also, you need to create a folder like ~/tools/java-conf/ and copy there all the content of the /etc/java-6-sun/ directory. This contains the JVM configuration, properties, management and security related settings.

Once this is done, you need to go through the copied JRE files and change the link files in order to point in the right direction – meaning to the configuration, properties, management and security files in ~/tools/java-conf/ on the cluster machine.

Almost done, all you need to do now is create a symlink (ln -s) to ~/tools/java/bin/java in the ~/bin/ directory. Most probably this is in the PATH already.

Now you should be able to run $java MyClass on the cluster machine.

Ruby

As far as I have seen with Ruby, installing it is not as easy as with JRE. In my case I had to compile Ruby on the cluster machine and also change the location of the libraries so that they get placed in the user’s home folder.

I have followed the following steps in order to get a successful Ruby installation:

  1. Create the ~/tools/ruby/ and ~/tools/ruby-code/ folders on the cluster machine. ~/tools/ruby/ will contain the Ruby installation while ~/tools/ruby-code/ will contain the code from which we will build Ruby. Once you complete the following steps, the code folder ~/tools/ruby-code/ can be deleted.
  2. Download the latest Ruby code from here. When I did this, the latest recommended Ruby version was 1.8.7-p72. After you downloaded it, extract the content of the .tar.gz into the ~/tools/ruby-code/ directory
  3. While logged into the cluster machine, cd to ~/tools/ruby-code/ruby-1.8.7-p72/ (the last folder in the path might look different if you are setting up a newer/older version of Ruby) and run the ./configure binary. This should generate the config.h and Makefile files.
  4. Edit config.h and look for the following 8 #define statement (they should be the last entries in the config.h file): RUBY_LIB, RUBY_SITE_LIB, RUBY_SITE_LIB2, RUBY_VENDOR_LIB, RUBY_VENDOR_LIB2, RUBY_ARCHLIB, RUBY_SITE_ARCHLIB, RUBY_VENDOR_ARCHLIB. The values you place in here should be absolute paths pointing towards sub-directories of the ~/tools/ruby/ directory on the cluster machine. As an example I have values something like:
    /home/tsalomie/tools/ruby/lib/ruby/1.8
    /home/tsalomie/tools/ruby/lib/ruby/site_ruby
    /home/tsalomie/tools/ruby/lib/site_ruby/1.8
    /home/tsalomie/tools/ruby/lib/ruby/vendor_ruby
    /home/tsalomie/tools/ruby/lib/vendor_ruby/1.8
    /home/tsalomie/tools/ruby/lib/ruby/1.8/x86_64-linux
    /home/tsalomie/tools/ruby/lib/ruby/site_ruby/1.8/x86_64-linux
    /home/tsalomie/tools/ruby/lib/ruby/vendor_ruby/1.8/x86_64-linux
  5. Run make in ~/tools/ruby-code/ruby-1.8.7-p72/
  6. Run make test to verify
  7. Edit the rbconfig.rb file, such that TOPDIR = ‘/home/tsalomie/tools/ruby’ and DESTDIR = ‘/home/tsalomie/tools/ruby’ unless defined? DESTDIR
  8. Run make install
  9. Create symlinks to ~/tools/ruby/bin/ruby and to ~/tools/ruby/bin/irb in your ~/bin directory
  10. Enjoy Ruby!
Filed in it, java, thoughts 0 comments
No comments yet. Be the first to leave a comment !
Leave a Comment

Name

Email

Website

Previous Post
«
Next Post
»

Switch to our mobile site