Tag Archives: java

Installing rJava in RHEL

Installing rJava on Ubuntu is a piece of cake. All you have to do the code below, and boom!!! You got rJava working in R.

 sudo apt-get install openjdk-7-jdk
 sudo apt-get install r-cran-rjava
 export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-i386
 export LD_LIBRARY_PATH=$JAVA_HOME/jre/lib/i386:$JAVA_HOME/jre/lib/i386/client

Now, the challenge was trying to get rJava working on RHEL. I could not find any proper documentation that worked. Instead, I ran into a bunch of posts and pointing to things that worked in their environment, but not on mine (so, this might not work on yours as well, but I hope it does). I usually like to give credit to the sources, but this time, they were so many over a long time span, that I could not remember what came from where anymore. So, I apologize for that. Below are the things that I did to get rJava working.

packages need

$ sudo yum install gcc-c++ gcc-gfortran R R-core R-core-devel R-devel R-java R-java-devel java-1.7.0-openjdk-devel
$ sudo yum list install gcc*

Once, you have installed the necessary packages; then it is time to

configure your environment

$ sudo /usr/sbin/alternatives --config java #select openjdk
$ sudo /usr/sbin/alternatives --config javac #select openjdk
$ export JAVA_HOME=/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.91.x86_64/jre
$ export PATH=$PATH:$JAVA_HOME/bin
$ sudo /usr/bin/R CMD javareconf
$ R
> install.packages("rJava") #install rJava on R console

And that is it! If you got the install.packages(“rJava”) to work on R, that means that now you can call Java from within R console.

IBM SPSS Modeler Streams with Excel export nodes fail with Insufficient memory for JVM – United States

From time to time you might run into some issues with SPSS Modeler of running out of memory on Java Virtual Memory.  The way you fix it is by expanding the allocated JVM.

So, in order to do this we mustdo the following…

  1. Close SPSS Modeler if you have it open
  2. Open C:\Program Files\IBM\SPSS\Modeler\\config\jvm.cfg as Administrator
  3. Find the line with the following
    options, "-Xmx256m"
  4. Now change "-Xmx256m" to a new value where 256m = RAM.  So if you would like to lets say allocate 1G of RAM, then you will change it to options, "-Xmx1024m".

Source: IBM Streams with Excel export nodes fail with Insufficient memory for JVM – United States

JavaRa

Whenever you upgrade your Sun Java Runtime Environment (JRE) there are still leftovers in your system and they takeup space and are vurnerables for intruders to attack your machine.  So in order to delete these files you could use this free app called JavaRa.

JavaRa is a free application that allows you to update your JRE to the latest version and also fully delete all old versions of Sun Java that are still in your system.

Download