<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://wiki.docking.org/index.php?action=history&amp;feed=atom&amp;title=Java_and_R</id>
	<title>Java and R - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://wiki.docking.org/index.php?action=history&amp;feed=atom&amp;title=Java_and_R"/>
	<link rel="alternate" type="text/html" href="http://wiki.docking.org/index.php?title=Java_and_R&amp;action=history"/>
	<updated>2026-06-26T14:41:43Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.39.1</generator>
	<entry>
		<id>http://wiki.docking.org/index.php?title=Java_and_R&amp;diff=9490&amp;oldid=prev</id>
		<title>Benrwong: Created page based on &quot;R &amp; JAVA&quot; from Lab Manual</title>
		<link rel="alternate" type="text/html" href="http://wiki.docking.org/index.php?title=Java_and_R&amp;diff=9490&amp;oldid=prev"/>
		<updated>2016-06-30T21:55:06Z</updated>

		<summary type="html">&lt;p&gt;Created page based on &amp;quot;R &amp;amp; JAVA&amp;quot; from Lab Manual&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==Installation==&lt;br /&gt;
&lt;br /&gt;
There are two ways to install java, one way is from source (which is done on the cluster) or the other way is through yum.  Yum is the easiest way to install it. &lt;br /&gt;
For the version through yum it’s easy, just type R, etc. &lt;br /&gt;
For using the one on the cluster, it’s much different.  You must install and configure java differently.  This is because the version on the cluster looks for a library that doesn’t exist on the default version (/usr/java/jdk1.7.0_67/include).  &lt;br /&gt;
Here are the steps for java:&lt;br /&gt;
&lt;br /&gt;
Go to this site to download Java rpms: &lt;br /&gt;
 http://www.oracle.com/technetwork/java/javase/downloads/index.html&lt;br /&gt;
&lt;br /&gt;
Make sure you download both the jdk and the jre.&lt;br /&gt;
 alternatives --install /usr/bin/java java /usr/java/latest/jre/bin/java 20000&lt;br /&gt;
 alternatives --config java  ---&amp;gt; To make sure it says that it’s the latest java&lt;br /&gt;
 alternatives --install /usr/bin/javac javac /usr/java/jdk1.7.0_67/bin/javac 20000&lt;br /&gt;
 alternatives --install /usr/bin/javaws javaws /usr/java/jre1.7.0_67/bin/javaws 20000&lt;br /&gt;
 alternatives --install /usr/bin/jar jar /usr/java/latest/bin/jar 20000 &lt;br /&gt;
Then once you are done with that, add the following in the .cshrc file:&lt;br /&gt;
____________________&lt;br /&gt;
&lt;br /&gt;
 source /nfs/soft/python/envs/complete/python-2.7.7/env.csh&lt;br /&gt;
 setenv JAVA_HOME &amp;#039;/usr/java/jdk1.7.0_67/jre&amp;#039;&lt;br /&gt;
 setenv JAVA &amp;#039;/usr/bin/java&amp;#039;&lt;br /&gt;
 setenv JAVAC &amp;#039;/usr/bin/javac&amp;#039;&lt;br /&gt;
 setenv JAVAH &amp;#039;/usr/java/jdk1.7.0_67/bin/javah&amp;#039;&lt;br /&gt;
 setenv JAR &amp;#039;/usr/java/jdk1.7.0_67/bin/jar&amp;#039;&lt;br /&gt;
 setenv JAVA_LIBS &amp;#039;-L$(JAVA_HOME)/lib/amd64/server -ljvm&amp;#039;&lt;br /&gt;
 setenv JAVA_CPPFLAGS &amp;#039;-I$(JAVA_HOME)/../include -I$(JAVA_HOME)/../include/linux -I/usr/local/include&amp;#039;&lt;br /&gt;
 setenv JAVA_LD_LIBRARY_PATH &amp;#039;$(JAVA_HOME)/lib/adm64/server:$(JAVA_HOME)/lib/amd64:$(JAVA_HOME)/../lib/amd64:$(JAVA_HOME)/lib:/usr/lib&amp;#039;&lt;br /&gt;
 &lt;br /&gt;
 alias R /nfs/soft/R/latest/bin/R&lt;br /&gt;
&lt;br /&gt;
You can try to install packages like this:&lt;br /&gt;
 R&lt;br /&gt;
 install.packages(‘rJava’)&lt;br /&gt;
&lt;br /&gt;
 Debugging java stuff: type R CMD javareconf -e&lt;br /&gt;
Make sure that the java variables in the .cshrc match the paths that javareconf prints to the screen.&lt;br /&gt;
For example, for Sarah I have the following in her .cshrc file:&lt;br /&gt;
 setenv JAVA_HOME &amp;#039;/usr/java/jdk1.7.0_67/jre&amp;#039;&lt;br /&gt;
 setenv JAVA &amp;#039;/usr/bin/java&amp;#039;&lt;br /&gt;
 setenv JAVAC &amp;#039;/usr/bin/javac&amp;#039;&lt;br /&gt;
 setenv JAVAH &amp;#039;/usr/java/jdk1.7.0_67/bin/javah&amp;#039;&lt;br /&gt;
 setenv JAR &amp;#039;/usr/java/jdk1.7.0_67/bin/jar&amp;#039;&lt;br /&gt;
 setenv JAVA_LIBS &amp;#039;-L$(JAVA_HOME)/lib/amd64/server -ljvm&amp;#039;&lt;br /&gt;
 setenv JAVA_CPPFLAGS &amp;#039;-I$(JAVA_HOME)/../include -I$(JAVA_HOME)/../include/linux -I/usr/local/include&amp;#039;&lt;br /&gt;
 setenv JAVA_LD_LIBRARY_PATH &amp;#039;$(JAVA_HOME)/lib/adm64/server:$(JAVA_HOME)/lib/amd64:$(JAVA_HOME)/../lib/amd64:$(JAVA_HOME)/lib:/usr/lib&amp;#039;&lt;br /&gt;
&lt;br /&gt;
==References for Java==&lt;br /&gt;
&lt;br /&gt;
References for Java:&lt;br /&gt;
http://www.if-not-true-then-false.com/2010/install-sun-oracle-java-jdk-jre-7-on-fedora-centos-red-hat-rhel/&lt;br /&gt;
&lt;br /&gt;
[[Category:Sysadmin]]&lt;br /&gt;
[[Category:Tutorials]]&lt;/div&gt;</summary>
		<author><name>Benrwong</name></author>
	</entry>
</feed>