Git Product home page Git Product logo

rjava's Introduction

rJava

CRAN RForge rJava check

R/Java interface allowing the use of Java from R as well as embedding R into Java (via JRI)

Please visit the main rJava project page on RForge.net for details on the project. For some FAQs and troubleshooting see below - read before reporting bugs!

Installation

Recommended installation of the CRAN version is via

install.packages("rJava")

in R. If you have all tools (and knowledge) necessary to compile R packages from sources, you can install the latest development version with

install.packages("rJava", repos="https://rforge.net")

The RForge.net repository is updated automatically on each commit. On macOS/Windows you may need to add type='source'.

IMPORTANT: You must have Java installed and it must be of the same architecture as the R you are using. See below for some troubleshooting help.

Sources

When checking out the sources, you must use

git clone --recursive https://github.com/s-u/rJava.git

since rJava includes REngine as a submodule. If you want to create a package from the source checkout, you must use sh mkdist to do so since the checkout is not the actual R package but a source to generate one (which involves compilation of Java code).

Bug reports

Please use rJava GitHub issues page to report bugs, but read the following documentation and search previous issues before you do so.

Troubleshooting

Rule #1: do not set JAVA_HOME unless you are an expert. rJava attempts to find the correct settings automatically on most platforms, so setting JAVA_HOME incorrecty will just break things.

Windows

Please make sure you install Java that matches your R architecture. R from CRAN is installed by default both in 32-bit and 64-bit versions so if in doubt, install both 32-bit and 64-bit Java. The most common mistake is to use 64-bit R but only have 32-bit Java installed.

rJava determines the Java location from the registry, so make sure you use the official Oracle installer so that your Java installation can be found.

macOS

On modern macOS versions Apple no longer supplies Java, so it must be downloaded from 3rd parties. Probably the most commonly used distributions on macOS are adoptium.net and Azul Zulu. Please note that if you are using arm64 R on Apple silicon (M1+) based Macs you will need at least R-4.1.2 or else you will get trap R errors when loading Java (see #267 for details).

When installing from a zip or tar ball, put your Java installation in /Library/Java/JavaVirtualMachines. For example, if installing Zulu, unpack/move it such that it results in /Library/Java/JavaVirtualMachines/zulu-11.jdk.

Most recent rJava version will try to automatically detect the Java location and load it dynamically. You can also check the version selected by your settings via /usr/libexec/java_home in the Terminal.

If you have multiple versions and want to pick one without changing the macOS Java settings, you can set JAVA_HOME but it must point to the Home directory inside the JDK, so, for example, for that above Zulu JDK that would be JAVA_HOME=/Library/Java/JavaVirtualMachines/zulu-11.jdk/Contents/Home. Again, don't do this unless you want to change the default behavior.

Linux

There is no standard location of JDK on Linux, so you must configure R with Java support before you can use rJava. It is usually done by running R CMD javareconf which detects all necessary settings and modifies the Java configuration in $R_HOME/etc/javaconf. Note that you must have sufficient privileges to update that file in order to configure R.

Also note that sudo may change environment variables, so if you need to run with elevated privileges, try sudo -i first then check if you still have access to the Java you want to use and then run R CMD javareconf. Alternatively you can temporarily change permissions on $R_HOME/etc to allow you to update it.

The way Java R configuration on Linux works is for the R start script to modify LD_LIBRARY_PATH to make sure the JVM libraries can be loaded (it does so according to the javaconf settings). Therefore if you use a process embbedding R you need to run it via R CMD <program> such that those setting are honored, otherwise you're on your own.

If you are installing rJava from sources, make sure you have the full JDK installed and all the necessary libraries needed to compile packages. For example, on Debian/Ubuntu that would require at least r-base-dev. If you run into issues, please check config.log which gives a clue as to what went wrong - usually some missing R dependency such as pcre2. The config.log file will be in the directory you used to build rJava in which is claned by R by default, so to keep it you can use e.g.:

curl -LO https://rforge.net/rJava/snapshot/rJava_1.0-6.tar.gz
tar fxz rJava_1.0-6.tar.gz
R CMD INSTALL rJava
## on failure check rJava/config.log

rjava's People

Contributors

fweimer-rh avatar kalibera avatar msannell avatar petermeissner avatar romainfrancois avatar russellpierce avatar s-u avatar tatsunagai avatar vpinna80 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

rjava's Issues

Encoding in rReadConsole and rWriteConsole

Hello, I try to use rtest.java as an example,I have some problems.
I use a file path as "C:/我",and assign it to a variable. a<- "C:/我"
I can getwd() and setwd(a) in R console.
But in rtest,I did as follow:
1.setwd("C:/我") using eval
2.x <- getwd()
3.y <- "C:/我"
4.all.equal(x,y) is FALSE
5.nchar(x) is 4, but nchar(y) is 5
6.but x and y has the same bytes when I breakpoint the rWriteConsole()
So, Which encoding should I config? Thanks.

Rengine or JRIEngine

When interacting with R through java, should I be using org.rosuda.JRI.Rengine or org.rosuda.REngine? The examples in the rJava folder use Rengine, but closed issue #12 references REngine.engineForClass(...) for best practices when creating REngines.

Thanks

rJava/jri compilation fails with parallel make (-j)

I'm running R-3.0.2 on Ubuntu x86_64, configured with --enable-R-shlib (not sure if this is important).

I just found out that my use of parallel make (via the setting MAKE=make -j2 in my ~/.R/config) was the cause of the following compilation error:

Rcallbacks.c:9:36: fatal error: org_rosuda_JRI_Rengine.h: No such file or directory
compilation terminated.
make[1]: *** [Rcallbacks.o] Error 1

when trying to install.packages("rJava").

To reproduce this:

  1. Download http://cran.r-project.org/src/contrib/rJava_0.9-6.tar.gz
  2. Run ./configure in the root directory of the extracted archive
  3. Run make -j2 in the jri subdirectory
    This fails with the above error, but using make -j1 works.

To be able to use install.packages("rJava") in R, I temporarily set MAKE=make -j1 in my ~/.R/Makevars.

Since it took quiet some time to track down the error, I thought I should write about it here as a reference for other affected users. Maybe it would also be worth mentioning this potential error in the installation notes on http://www.rforge.net/rJava/.

.jarray does not create an array of shorts

How to create a java array of shorts? The .jarray method returns array of integers, even if the type is specified:

data = c(1,2,3,4)
.jarray(.jshort(data))
[1] "Java-Array-Object[I:[I@4cd4aaf6"
.jarray(.jshort(data), "[S")
[1] "Java-Array-Object[I:[I@1e2423e2"

The same code for long values works perfectly:

.jarray(.jlong(data))
[1] "Java-Array-Object[J:[J@3309f28b"

What am I doing wrong?

Cannot install on Yosemite: homebrew-cask java 1.8.0_25, homebrew R 3.1.2

Not sure this is a rJava problem but looking for help.

Installing R via homebrew gives me this message:

To enable rJava support, run the following command:
  R CMD javareconf JAVA_CPPFLAGS=-I/System/Library/Frameworks/JavaVM.framework/Headers
If you've installed a version of Java other than the default, you might need to instead use:
  R CMD javareconf JAVA_CPPFLAGS='-I/System/Library/Frameworks/JavaVM.framework/Headers -I/Library/Java/JavaVirtualMachines/jdk<version>.jdk/'
  (where <version> can be found by running `java -version` or `locate jni.h`)

Bash completion has been installed to:
  /usr/local/etc/bash_completion.d

running either (subbing jdk1.8.0_25.jdk for <version>) fails not finding jni.h

java installs jni.h into

/Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk/Contents/Home/include

Since there was nothing at /System/Library/Frameworks/JavaVM.framework/Headers/ where javareconf seems to want to look for it, I created symlinks:

cd /System/Library/Frameworks/JavaVM.framework/Versions
sudo ln -nsf /Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk/Contents ./CurrentJDK
cd /System/Library/Frameworks/JavaVM.framework
sudo ln -nsf Versions/CurrentJDK/Home/include/ ./Headers

and added

export JAVA_HOME = "/Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk/Contents/Home"

to ~/.bash_profile since without it javareconf says the JAVA_HOME is not a valid path. This allows javareconf to find jni.h using:

R CMD javareconf JAVA_CPPFLAGS=-I/System/Library/Frameworks/JavaVM.framework/Headers -I/System/Library/Frameworks/JavaVM.framework/Headers/

but then javareconf fails because it can't find jni_md.h which is in /Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk/Contents/Home/include/dawrin

looking at javareconf there is this code:

    ## only if we get jni.h we can try to find jni_md.h
    if test -n "${jinc}"; then
       JAVA_CPPFLAGS="-I${jinc}"
       jmdinc=''
       jmdirs=''
   ## we are not in configure, so we need to find the OS from R
   host_os=`echo 'cat(R.version$os)'|${R_HOME}/bin/R --vanilla --slave 2>/dev/null`
       ## put the most probable locations for each system in the first place
       case "${host_os}" in
         darwin*)  jmdirs=darwin;;
         linux*)   jmdirs=linux;;
         bsdi*)    jmdirs=bsdos;;
         osf*)     jmdirs=alpha;;
         solaris*) jmdirs=solaris;;
         freebsd*) jmdirs=freebsd; add_java_libs='-lpthread';;
       esac

I would think that this would allow javareconf to find the jni_md.h but that's not happening.

This may not be a rJava issue but since the R install said to run javareconf in order to enable rJava support, I thought I would post here, but then again, I know just enough to know that I know nothing about this stuff. I'm just bummed I can't get rJava installed in R.

Thanks for taking the time to read this.

RJavaClassLoader and System classloader issue

Hi,

I have posted a question on [R-help] and was adviced to post it here instead: https://stat.ethz.ch/pipermail/r-help/2014-September/422039.html

Here is a more detailed example.

I have 3 classes:

  • ClassToLoad.java
  • HelloWorldClassloader.java
  • Main.java

The ClassToLoad has only one method:
package org.test;
public class ClassToLoad {
public String sayHello() {
return "Hello class loader";
}
}

The HelloWorldClassLoader is a Classloader that extends the System ClassLoader. It does not do anything in particular, it just prints what packages its parent classloader (i.e. the System classsloader) knows.
package org.test;
public class HelloWorldClassLoader extends ClassLoader {
public HelloWorldClassLoader() {
super(ClassLoader.getSystemClassLoader());
}
@OverRide
public Class<?> loadClass(final String name) throws ClassNotFoundException {
System.out.println("Loading class: " + name);
System.out.println("Parent classloader knows:");
final Package[] packages = super.getPackages();
for (final Package packageObject : packages) {
if (packageObject.getName().startsWith("org.test")) {
System.out.println(" - " + packageObject.getName());
}
}
return super.loadClass(name);
}
}

Finally, we have the Main class, that instantiates the ClassToLoad with the HelloWorldClassLoader and should print "Hello class loader":

package org.test;
public class Main {
public static void main(final String[] args) {
System.out.println(new Main().start());
}
private String start() {
final ClassLoader classLoader = this.getClass().getClassLoader();
System.out.println(classLoader);
String result = null;
final HelloWorldClassLoader myClassLoader = new HelloWorldClassLoader();
try {
final Class<?> myClass = myClassLoader.loadClass("org.test.ClassToLoad");
result = ((ClassToLoad) myClass.newInstance()).sayHello();
} catch (final ClassNotFoundException e) {
e.printStackTrace();
} catch (final InstantiationException e) {
e.printStackTrace();
} catch (final IllegalAccessException e) {
e.printStackTrace();
}
return result;
}
}

In a pure Java context, the output is the following:
sun.misc.Launcher$AppClassLoader@39172e08
Loading class: org.test.ClassToLoad
Parent classloader knows:

  • org.test
    Hello class loader

In R context, I have created the following function:
main <- function(){
main <- .jnew("org/test/Main") # create instance of Main class
out <- .jcall(main, "S", "start") # invoke start method
return(out)
}

And the output is:
RJavaClassLoader@2666e815
Loading class: org.test.ClassToLoad
Parent classloader knows:
java.lang.ClassNotFoundException: org.test.ClassToLoad
at java.lang.ClassLoader.findClass(ClassLoader.java:364)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
at org.test.HelloWorldClassLoader.loadClass(HelloWorldClassLoader.java:23)
at org.test.Main.start(Main.java:17)

Which is logical: the HelloWorldClassLoader is a child of the system classloader. In R context, the SystemClassLoader does not know about the JAR provided in the R package. Only RJavaClassLoader knows about the JAR.

In my application, that has to work in both Java and R contexts, I have a plugins loading mechanism that is very similar. When launched in R context, it does not work for this exact reason. Is this a bug in rJava? Or is there a way to configure rJava so that the System ClassLoader knows about the provided Jar?

Thanks for your time and your help,

Kind regards,

Ben

NA conversion in character vector

I wonder why rJava converts character NA to a String object "NA" rather than null.
If there was a good reason for this, would it still be possible to add control over NA conversion?
Also is it somehow possible to convert other types like numeric and integer to an array of boxed values instead of raw values, so that we can convert NA here also to null?

Support for reloading class files when changed (hot swapping)

During development classes tend to change quite often. Currently rJava seems to load a class definition only once. I have to restart R in order to test a new version of a Java class.

Is there a way to make rJava "reload" a class definition somehow? I experimented with a custom class loader but with no avail.

Error in .jnew("myClass") : java.lang.ClassNotFoundException

Simon,

I'm having a similar issue to this gentleman; however, everything looks consistent on the Java version
front. I'm not sure if there's a bug with .jinit(...) referencing .jar files or if this is user error.

Here's the scenario:

I have a project with a host of classes as well as a .jar file:

classes/
    |
    -- io/
    |    |
    |    -- swagger/
    |    |    |
    |    |    -- client/
    |    |    |    -- ApiClient.class
    |    |    |    -- ApiException.class
    |    |    |    |
    -- swagger-java-client-1.0.0.jar

listing the classes in the jar seems to point me to the correct paths:

$ jar tf swagger-java-client-1.0.0.jar
io/swagger/
io/swagger/client/
io/swagger/client/api/
io/swagger/client/auth/
io/swagger/client/model/
io/swagger/client/ApiClient.class
io/swagger/client/ApiException.class
[...]

checking the java version(s) at play:

[in R]

> .jcall("java/lang/System","S","getProperty","java.version")
[1] "1.6.0_65"

[at command line]

$ file classes/io/swagger/client/ApiClient.class
classes/io/swagger/client/ApiClient.class: compiled Java class data, version 50.0 (Java 
1.6)

yet, when getting things going with rJava, I run into an error:

[in R]

> library("rJava")
> .jinit("/Users/scott/Documents/java_client/client/target/swagger-java-client-1.0.0.jar")
> .jclassPath()
[1] "/Library/Frameworks/R.framework/Versions/3.2/Resources/library/rJava/java"     
[2] "/Users/scott/Documents/java_client/client/target/swagger-java-client-1.0.0.jar"
> .jnew("ApiClient")
Error in .jnew("ApiClient") : java.lang.ClassNotFoundException

The java class itself does make use of a package; not sure if that's relevant for my .jnew(...)
call?

[in .../src/main/java/io/swagger/client/ApiClient.java]

package io.swagger.client;

// a lot of import statements

public class ApiClient {

// code

}

Running rJava from JRI in JBoss application server

I'm running an R script in Jboss (a java application server) using JRI. Within the R script I have a call to a Java class.

Therefore, this is what I have:

Java program in JBoss --> invokes JRI and runs R script --> invokes Java program.

When I attempt to run the following script in JRI (or instantiate any class from rJava):

s <- .jnew("java/lang/String", "Hello World")

The object is created, however Java throws the following exception:

22:18:29,973 ERROR stderr java.lang.NoClassDefFoundError: RJavaClassLoader

22:18:29,973 ERROR stderr at org.rosuda.JRI.Rengine.rniEval(Native Method)

22:18:29,973 ERROR stderr at org.rosuda.REngine.JRI.JRIEngine.eval(JRIEngine.java:281)

22:18:29,973 ERROR stderr at org.rosuda.REngine.REngine.parseAndEval(REngine.java:102)

22:18:29,973 ERROR stderr at org.rosuda.REngine.REngine.parseAndEval(REngine.java:108)

Even though the exception is thrown, I can continue executing other statements, for example:

print(s) 

will execute correctly.

The first time I run any rJava statement, I get the exception.

I know that is possible to run rJava from within JRI, but is it possible in an application server like Jboss instead of a plain Java object? rJava would need to have access to Jboss' JVM.

Troubles installing JRI

Hi everyone!

I tried to install JRI but the "make"-process fails with the following error:

Rengine.c:651:20: error: 'R_interrupts_pending' undeclared (first use in this function)
if (flag == 0) R_interrupts_pending = 1;

I am using WIN 7 with MinGW.

This is the result of “sh configure.win”
Generate Windows-specific files (src/jvm-w32) ...
make: Entering directory /g/JRI_0.5-5/JRI/src/win32' make: Nothing to be done forall'.
make: Leaving directory `/g/JRI_0.5-5/JRI/src/win32'
Find Java...
JAVA_HOME=C:/PROGRA1/Java/JDK171.0_4
R_HOME=E:/R-31~1.0
Creating Makefiles ...
Configuration done.

Here is the full "error-log" of the make-process
In file included from Rengine.c:41:0:
E:/R-311.0/include/R_ext/eventloop.h:73:65: error: unknown type name 'fd_set'
extern InputHandler _getSelectedHandler(InputHandler *handlers, fd_set *mask);
^
E:/R-31
1.0/include/R_ext/eventloop.h:74:1: error: unknown type name 'fd_set'
extern fd_set *R_checkActivity(int usec, int ignore_stdin);
^
E:/R-311.0/include/R_ext/eventloop.h:75:1: error: unknown type name 'fd_set'
extern fd_set *R_checkActivityEx(int usec, int ignore_stdin, void (_intr)(void));
^
E:/R-31
1.0/include/R_ext/eventloop.h:76:51: error: unknown type name 'fd_set'
extern void R_runHandlers(InputHandler handlers, fd_set *mask);
^
E:/R-311.0/include/R_ext/eventloop.h:78:32: error: unknown type name 'fd_set'
extern int R_SelectEx(int n, fd_set *readfds, fd_set *writefds,
^
E:/R-31
1.0/include/R_ext/eventloop.h:78:51: error: unknown type name 'fd_set'
extern int R_SelectEx(int n, fd_set *readfds, fd_set *writefds,
^
E:/R-311.0/include/R_ext/eventloop.h:79:9: error: unknown type name 'fd_set'
fd_set *exceptfds, struct timeval *timeout,
^
In file included from Rengine.c:4:0:
Rengine.c: In function 'Java_org_rosuda_JRI_Rengine_rniParse':
jri.h:21:20: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
#define SEXP2L(s) ((jlong)(s))
^
Rengine.c:121:14: note: in expansion of macro 'SEXP2L'
return SEXP2L(pstr);
^
Rengine.c: In function 'Java_org_rosuda_JRI_Rengine_rniEval':
jri.h:25:20: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
#define L2SEXP(s) ((SEXP)((jlong)((unsigned long)(s))))
^
Rengine.c:135:36: note: in expansion of macro 'L2SEXP'
SEXP es = R_NilValue, exps = L2SEXP(exp);
^
jri.h:25:20: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
#define L2SEXP(s) ((SEXP)((jlong)((unsigned long)(s))))
^
Rengine.c:136:23: note: in expansion of macro 'L2SEXP'
SEXP eval_env = L2SEXP(rho);
^
jri.h:21:20: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
#define SEXP2L(s) ((jlong)(s))
^
Rengine.c:159:14: note: in expansion of macro 'SEXP2L'
return SEXP2L(es);
^
Rengine.c: In function 'Java_org_rosuda_JRI_Rengine_rniAssign':
jri.h:25:20: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
#define L2SEXP(s) ((SEXP)((jlong)((unsigned long)(s))))
^
Rengine.c:179:20: note: in expansion of macro 'L2SEXP'
s.rho = rhoL ? L2SEXP(rhoL) : R_GlobalEnv;
^
jri.h:25:20: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
#define L2SEXP(s) ((SEXP)((jlong)((unsigned long)(s))))
^
Rengine.c:180:20: note: in expansion of macro 'L2SEXP'
s.val = valL ? L2SEXP(valL) : R_NilValue;
^
In file included from jri.h:6:0,
from Rengine.c:4:
Rengine.c: In function 'Java_org_rosuda_JRI_Rengine_rniProtect':
jri.h:25:20: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
#define L2SEXP(s) ((SEXP)((jlong)((unsigned long)(s))))
^
E:/R-31
1.0/include/Rinternals.h:627:31: note: in definition of macro 'PROTECT'
#define PROTECT(s) Rf_protect(s)
^
Rengine.c:189:10: note: in expansion of macro 'L2SEXP'
PROTECT(L2SEXP(exp));
^
In file included from Rengine.c:4:0:
Rengine.c: In function 'Java_org_rosuda_JRI_Rengine_rniRelease':
jri.h:25:20: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
#define L2SEXP(s) ((SEXP)((jlong)((unsigned long)(s))))
^
Rengine.c:201:27: note: in expansion of macro 'L2SEXP'
if (exp) R_ReleaseObject(L2SEXP(exp));
^
Rengine.c: In function 'Java_org_rosuda_JRI_Rengine_rniPreserve':
jri.h:25:20: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
#define L2SEXP(s) ((SEXP)((jlong)((unsigned long)(s))))
^
Rengine.c:207:28: note: in expansion of macro 'L2SEXP'
if (exp) R_PreserveObject(L2SEXP(exp));
^
Rengine.c: In function 'Java_org_rosuda_JRI_Rengine_rniPrintValue':
jri.h:25:20: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
#define L2SEXP(s) ((SEXP)((jlong)((unsigned long)(s))))
^
Rengine.c:213:22: note: in expansion of macro 'L2SEXP'
Rf_PrintValue(exp ? L2SEXP(exp) : R_NilValue);
^
Rengine.c: In function 'Java_org_rosuda_JRI_Rengine_rniParentEnv':
jri.h:25:20: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
#define L2SEXP(s) ((SEXP)((jlong)((unsigned long)(s))))
^
jri.h:21:28: note: in definition of macro 'SEXP2L'
#define SEXP2L(s) ((jlong)(s))
^
Rengine.c:219:30: note: in expansion of macro 'L2SEXP'
return SEXP2L(ENCLOS(exp ? L2SEXP(exp) : R_GlobalEnv));
^
jri.h:21:20: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
#define SEXP2L(s) ((jlong)(s))
^
Rengine.c:219:10: note: in expansion of macro 'SEXP2L'
return SEXP2L(ENCLOS(exp ? L2SEXP(exp) : R_GlobalEnv));
^
Rengine.c: In function 'Java_org_rosuda_JRI_Rengine_rniFindVar':
jri.h:25:20: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
#define L2SEXP(s) ((SEXP)((jlong)((unsigned long)(s))))
^
jri.h:21:28: note: in definition of macro 'SEXP2L'
#define SEXP2L(s) ((jlong)(s))
^
Rengine.c:228:38: note: in expansion of macro 'L2SEXP'
return SEXP2L(Rf_findVar(sym, rho ? L2SEXP(rho) : R_GlobalEnv));
^
jri.h:21:20: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
#define SEXP2L(s) ((jlong)(s))
^
Rengine.c:228:9: note: in expansion of macro 'SEXP2L'
return SEXP2L(Rf_findVar(sym, rho ? L2SEXP(rho) : R_GlobalEnv));
^
Rengine.c: In function 'Java_org_rosuda_JRI_Rengine_rniListEnv':
jri.h:25:20: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
#define L2SEXP(s) ((SEXP)((jlong)((unsigned long)(s))))
^
jri.h:21:28: note: in definition of macro 'SEXP2L'
#define SEXP2L(s) ((jlong)(s))
^
Rengine.c:234:35: note: in expansion of macro 'L2SEXP'
return SEXP2L(R_lsInternal(rho ? L2SEXP(rho) : R_GlobalEnv, all));
^
jri.h:21:20: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
#define SEXP2L(s) ((jlong)(s))
^
Rengine.c:234:9: note: in expansion of macro 'SEXP2L'
return SEXP2L(R_lsInternal(rho ? L2SEXP(rho) : R_GlobalEnv, all));
^
Rengine.c: In function 'Java_org_rosuda_JRI_Rengine_rniSpecialObject':
jri.h:21:20: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
#define SEXP2L(s) ((jlong)(s))
^
Rengine.c:241:18: note: in expansion of macro 'SEXP2L'
case 0: return SEXP2L(R_NilValue);
^
jri.h:21:20: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
#define SEXP2L(s) ((jlong)(s))
^
Rengine.c:242:18: note: in expansion of macro 'SEXP2L'
case 1: return SEXP2L(R_GlobalEnv);
^
jri.h:21:20: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
#define SEXP2L(s) ((jlong)(s))
^
Rengine.c:243:18: note: in expansion of macro 'SEXP2L'
case 2: return SEXP2L(R_EmptyEnv);
^
jri.h:21:20: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
#define SEXP2L(s) ((jlong)(s))
^
Rengine.c:244:18: note: in expansion of macro 'SEXP2L'
case 3: return SEXP2L(R_BaseEnv);
^
jri.h:21:20: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
#define SEXP2L(s) ((jlong)(s))
^
Rengine.c:245:18: note: in expansion of macro 'SEXP2L'
case 4: return SEXP2L(R_UnboundValue);
^
jri.h:21:20: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
#define SEXP2L(s) ((jlong)(s))
^
Rengine.c:246:18: note: in expansion of macro 'SEXP2L'
case 5: return SEXP2L(R_MissingArg);
^
jri.h:21:20: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
#define SEXP2L(s) ((jlong)(s))
^
Rengine.c:247:18: note: in expansion of macro 'SEXP2L'
case 6: return SEXP2L(R_NaString);
^
jri.h:21:20: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
#define SEXP2L(s) ((jlong)(s))
^
Rengine.c:248:18: note: in expansion of macro 'SEXP2L'
case 7: return SEXP2L(R_BlankString);
^
Rengine.c: In function 'Java_org_rosuda_JRI_Rengine_rniXrefToJava':
jri.h:25:20: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
#define L2SEXP(s) ((SEXP)((jlong)((unsigned long)(s))))
^
Rengine.c:256:12: note: in expansion of macro 'L2SEXP'
SEXP xp = L2SEXP(exp);
^
Rengine.c: In function 'Java_org_rosuda_JRI_Rengine_rniJavaToXref':
jri.h:21:20: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
#define SEXP2L(s) ((jlong)(s))
^
Rengine.c:266:10: note: in expansion of macro 'SEXP2L'
return SEXP2L(R_MakeExternalPtr(go, R_NilValue, R_NilValue));
^
Rengine.c: In function 'Java_org_rosuda_JRI_Rengine_rniGetString':
jri.h:25:20: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
#define L2SEXP(s) ((SEXP)((jlong)((unsigned long)(s))))
^
Rengine.c:272:33: note: in expansion of macro 'L2SEXP'
return jri_putString(env, L2SEXP(exp), 0);
^
Rengine.c: In function 'Java_org_rosuda_JRI_Rengine_rniGetStringArray':
jri.h:25:20: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
#define L2SEXP(s) ((SEXP)((jlong)((unsigned long)(s))))
^
Rengine.c:279:38: note: in expansion of macro 'L2SEXP'
return jri_putStringArray(env, L2SEXP(exp));
^
Rengine.c: In function 'Java_org_rosuda_JRI_Rengine_rniGetIntArray':
jri.h:25:20: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
#define L2SEXP(s) ((SEXP)((jlong)((unsigned long)(s))))
^
Rengine.c:285:35: note: in expansion of macro 'L2SEXP'
return jri_putIntArray(env, L2SEXP(exp));
^
Rengine.c: In function 'Java_org_rosuda_JRI_Rengine_rniGetRawArray':
jri.h:25:20: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
#define L2SEXP(s) ((SEXP)((jlong)((unsigned long)(s))))
^
Rengine.c:291:36: note: in expansion of macro 'L2SEXP'
return jri_putByteArray(env, L2SEXP(exp));
^
Rengine.c: In function 'Java_org_rosuda_JRI_Rengine_rniGetBoolArrayI':
jri.h:25:20: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
#define L2SEXP(s) ((SEXP)((jlong)((unsigned long)(s))))
^
Rengine.c:297:37: note: in expansion of macro 'L2SEXP'
return jri_putBoolArrayI(env, L2SEXP(exp));
^
Rengine.c: In function 'Java_org_rosuda_JRI_Rengine_rniGetDoubleArray':
jri.h:25:20: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
#define L2SEXP(s) ((SEXP)((jlong)((unsigned long)(s))))
^
Rengine.c:303:38: note: in expansion of macro 'L2SEXP'
return jri_putDoubleArray(env, L2SEXP(exp));
^
Rengine.c: In function 'Java_org_rosuda_JRI_Rengine_rniGetVector':
jri.h:25:20: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
#define L2SEXP(s) ((SEXP)((jlong)((unsigned long)(s))))
^
Rengine.c:309:35: note: in expansion of macro 'L2SEXP'
return jri_putSEXPLArray(env, L2SEXP(exp));
^
Rengine.c: In function 'Java_org_rosuda_JRI_Rengine_rniExpType':
jri.h:25:20: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
#define L2SEXP(s) ((SEXP)((jlong)((unsigned long)(s))))
^
Rengine.c:315:25: note: in expansion of macro 'L2SEXP'
return exp ? TYPEOF(L2SEXP(exp)) : 0;
^
Rengine.c: In function 'Java_org_rosuda_JRI_Rengine_rniIdle':
Rengine.c:322:5: warning: implicit declaration of function 'R_runHandlers' [-Wimplicit-function-declaration]
R_runHandlers(R_InputHandlers, R_checkActivity(0, 1));
^
In file included from Rengine.c:4:0:
Rengine.c: In function 'Java_org_rosuda_JRI_Rengine_rniPutString':
jri.h:21:20: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
#define SEXP2L(s) ((jlong)(s))
^
Rengine.c:335:12: note: in expansion of macro 'SEXP2L'
return SEXP2L(jri_getString(env, s));
^
Rengine.c: In function 'Java_org_rosuda_JRI_Rengine_rniPutStringArray':
jri.h:21:20: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
#define SEXP2L(s) ((jlong)(s))
^
Rengine.c:341:12: note: in expansion of macro 'SEXP2L'
return SEXP2L(jri_getStringArray(env, a));
^
Rengine.c: In function 'Java_org_rosuda_JRI_Rengine_rniPutIntArray':
jri.h:21:20: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
#define SEXP2L(s) ((jlong)(s))
^
Rengine.c:347:12: note: in expansion of macro 'SEXP2L'
return SEXP2L(jri_getIntArray(env, a));
^
Rengine.c: In function 'Java_org_rosuda_JRI_Rengine_rniPutRawArray':
jri.h:21:20: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
#define SEXP2L(s) ((jlong)(s))
^
Rengine.c:353:12: note: in expansion of macro 'SEXP2L'
return SEXP2L(jri_getByteArray(env, a));
^
Rengine.c: In function 'Java_org_rosuda_JRI_Rengine_rniPutBoolArrayI':
jri.h:21:20: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
#define SEXP2L(s) ((jlong)(s))
^
Rengine.c:359:12: note: in expansion of macro 'SEXP2L'
return SEXP2L(jri_getBoolArrayI(env, a));
^
Rengine.c: In function 'Java_org_rosuda_JRI_Rengine_rniPutBoolArray':
jri.h:21:20: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
#define SEXP2L(s) ((jlong)(s))
^
Rengine.c:365:12: note: in expansion of macro 'SEXP2L'
return SEXP2L(jri_getBoolArray(env, a));
^
Rengine.c: In function 'Java_org_rosuda_JRI_Rengine_rniPutDoubleArray':
jri.h:21:20: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
#define SEXP2L(s) ((jlong)(s))
^
Rengine.c:371:12: note: in expansion of macro 'SEXP2L'
return SEXP2L(jri_getDoubleArray(env, a));
^
Rengine.c: In function 'Java_org_rosuda_JRI_Rengine_rniPutVector':
jri.h:21:20: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
#define SEXP2L(s) ((jlong)(s))
^
Rengine.c:377:12: note: in expansion of macro 'SEXP2L'
return SEXP2L(jri_getSEXPLArray(env, a));
^
Rengine.c: In function 'Java_org_rosuda_JRI_Rengine_rniGetAttr':
jri.h:25:20: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
#define L2SEXP(s) ((SEXP)((jlong)((unsigned long)(s))))
^
Rengine.c:384:44: note: in expansion of macro 'L2SEXP'
if (!an || an==R_NilValue || exp==0 || L2SEXP(exp)==R_NilValue) return 0;
^
jri.h:25:20: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
#define L2SEXP(s) ((SEXP)((jlong)((unsigned long)(s))))
^
Rengine.c:386:28: note: in expansion of macro 'L2SEXP'
SEXP a = getAttrib(L2SEXP(exp), an);
^
jri.h:21:20: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
#define SEXP2L(s) ((jlong)(s))
^
Rengine.c:387:34: note: in expansion of macro 'SEXP2L'
return (a==R_NilValue)?0:SEXP2L(a);
^
Rengine.c: In function 'Java_org_rosuda_JRI_Rengine_rniGetAttrNames':
jri.h:25:20: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
#define L2SEXP(s) ((SEXP)((jlong)((unsigned long)(s))))
^
Rengine.c:394:14: note: in expansion of macro 'L2SEXP'
SEXP o = L2SEXP(exp);
^
Rengine.c: In function 'Java_org_rosuda_JRI_Rengine_rniSetAttr':
jri.h:25:20: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
#define L2SEXP(s) ((SEXP)((jlong)((unsigned long)(s))))
^
Rengine.c:426:44: note: in expansion of macro 'L2SEXP'
if (!an || an==R_NilValue || exp==0 || L2SEXP(exp)==R_NilValue) return;
^
jri.h:25:20: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
#define L2SEXP(s) ((SEXP)((jlong)((unsigned long)(s))))
^
Rengine.c:428:15: note: in expansion of macro 'L2SEXP'
setAttrib(L2SEXP(exp), an, (attr==0)?R_NilValue:L2SEXP(attr));
^
jri.h:25:20: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
#define L2SEXP(s) ((SEXP)((jlong)((unsigned long)(s))))
^
Rengine.c:428:53: note: in expansion of macro 'L2SEXP'
setAttrib(L2SEXP(exp), an, (attr==0)?R_NilValue:L2SEXP(attr));
^
Rengine.c: In function 'Java_org_rosuda_JRI_Rengine_rniInstallSymbol':
jri.h:21:20: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
#define SEXP2L(s) ((jlong)(s))
^
Rengine.c:441:12: note: in expansion of macro 'SEXP2L'
return SEXP2L(jri_installString(env, s));
^
Rengine.c: In function 'Java_org_rosuda_JRI_Rengine_rniGetSymbolName':
jri.h:25:20: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
#define L2SEXP(s) ((SEXP)((jlong)((unsigned long)(s))))
^
Rengine.c:447:32: note: in expansion of macro 'L2SEXP'
return jri_putSymbolName(env, L2SEXP(exp));
^
Rengine.c: In function 'Java_org_rosuda_JRI_Rengine_rniInherits':
jri.h:25:20: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
#define L2SEXP(s) ((SEXP)((jlong)((unsigned long)(s))))
^
Rengine.c:457:16: note: in expansion of macro 'L2SEXP'
if (inherits(L2SEXP(exp), (char
)c)) res = 1;
^
In file included from jri.h:6:0,
from Rengine.c:4:
Rengine.c: In function 'Java_org_rosuda_JRI_Rengine_rniCons':
jri.h:25:20: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
#define L2SEXP(s) ((SEXP)((jlong)((unsigned long)(s))))
^
E:/R-311.0/include/Rinternals.h:538:28: note: in definition of macro 'LCONS'
#define LCONS(a, b) lcons((a), (b)) /* language lists _/
^
Rengine.c:468:36: note: in expansion of macro 'L2SEXP'
l = LCONS((head==0)?R_NilValue:L2SEXP(head), (tail==0)?R_NilValue:L2SEXP(tail));
^
jri.h:25:20: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
#define L2SEXP(s) ((SEXP)((jlong)((unsigned long)(s))))
^
E:/R-31
1.0/include/Rinternals.h:538:33: note: in definition of macro 'LCONS'
#define LCONS(a, b) lcons((a), (b)) /_ language lists /
^
Rengine.c:468:71: note: in expansion of macro 'L2SEXP'
l = LCONS((head==0)?R_NilValue:L2SEXP(head), (tail==0)?R_NilValue:L2SEXP(tail));
^
jri.h:25:20: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
#define L2SEXP(s) ((SEXP)((jlong)((unsigned long)(s))))
^
E:/R-31~1.0/include/Rinternals.h:537:26: note: in definition of macro 'CONS'
#define CONS(a, b) cons((a), (b)) /
data lists /
^
Rengine.c:470:35: note: in expansion of macro 'L2SEXP'
l = CONS((head==0)?R_NilValue:L2SEXP(head), (tail==0)?R_NilValue:L2SEXP(tail));
^
jri.h:25:20: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
#define L2SEXP(s) ((SEXP)((jlong)((unsigned long)(s))))
^
E:/R-31~1.0/include/Rinternals.h:537:31: note: in definition of macro 'CONS'
#define CONS(a, b) cons((a), (b)) /
data lists /
^
Rengine.c:470:70: note: in expansion of macro 'L2SEXP'
l = CONS((head==0)?R_NilValue:L2SEXP(head), (tail==0)?R_NilValue:L2SEXP(tail));
^
In file included from Rengine.c:4:0:
jri.h:25:20: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
#define L2SEXP(s) ((SEXP)((jlong)((unsigned long)(s))))
^
Rengine.c:472:23: note: in expansion of macro 'L2SEXP'
if (tag) SET_TAG(l, L2SEXP(tag));
^
jri.h:21:20: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
#define SEXP2L(s) ((jlong)(s))
^
Rengine.c:473:10: note: in expansion of macro 'SEXP2L'
return SEXP2L(l);
^
Rengine.c: In function 'Java_org_rosuda_JRI_Rengine_rniCAR':
jri.h:25:20: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
#define L2SEXP(s) ((SEXP)((jlong)((unsigned long)(s))))
^
Rengine.c:480:22: note: in expansion of macro 'L2SEXP'
SEXP r = CAR(L2SEXP(exp));
^
jri.h:21:20: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
#define SEXP2L(s) ((jlong)(s))
^
Rengine.c:481:34: note: in expansion of macro 'SEXP2L'
return (r==R_NilValue)?0:SEXP2L(r);
^
Rengine.c: In function 'Java_org_rosuda_JRI_Rengine_rniCDR':
jri.h:25:20: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
#define L2SEXP(s) ((SEXP)((jlong)((unsigned long)(s))))
^
Rengine.c:490:22: note: in expansion of macro 'L2SEXP'
SEXP r = CDR(L2SEXP(exp));
^
jri.h:21:20: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
#define SEXP2L(s) ((jlong)(s))
^
Rengine.c:491:34: note: in expansion of macro 'SEXP2L'
return (r==R_NilValue)?0:SEXP2L(r);
^
Rengine.c: In function 'Java_org_rosuda_JRI_Rengine_rniTAG':
jri.h:25:20: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
#define L2SEXP(s) ((SEXP)((jlong)((unsigned long)(s))))
^
Rengine.c:500:22: note: in expansion of macro 'L2SEXP'
SEXP r = TAG(L2SEXP(exp));
^
jri.h:21:20: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
#define SEXP2L(s) ((jlong)(s))
^
Rengine.c:501:34: note: in expansion of macro 'SEXP2L'
return (r==R_NilValue)?0:SEXP2L(r);
^
Rengine.c: In function 'Java_org_rosuda_JRI_Rengine_rniPutList':
jri.h:21:20: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
#define SEXP2L(s) ((jlong)(s))
^
Rengine.c:516:21: note: in expansion of macro 'SEXP2L'
if (l<1) return SEXP2L(CONS(R_NilValue, R_NilValue));
^
In file included from jri.h:6:0,
from Rengine.c:4:
jri.h:25:20: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
#define L2SEXP(s) ((SEXP)((jlong)((unsigned long)(s))))
^
E:/R-31~1.0/include/Rinternals.h:537:26: note: in definition of macro 'CONS'
#define CONS(a, b) cons((a), (b)) /
data lists /
^
Rengine.c:521:38: note: in expansion of macro 'L2SEXP'
t=CONS((ap[i]==0)?R_NilValue:L2SEXP(ap[i]), t);
^
In file included from Rengine.c:4:0:
jri.h:21:20: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
#define SEXP2L(s) ((jlong)(s))
^
Rengine.c:526:12: note: in expansion of macro 'SEXP2L'
return SEXP2L(t);
^
Rengine.c: In function 'Java_org_rosuda_JRI_Rengine_rniGetList':
jri.h:25:20: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
#define L2SEXP(s) ((SEXP)((jlong)((unsigned long)(s))))
^
Rengine.c:533:12: note: in expansion of macro 'L2SEXP'
SEXP e=L2SEXP(exp);
^
jri.h:21:20: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
#define SEXP2L(s) ((jlong)(s))
^
Rengine.c:560:51: note: in expansion of macro 'SEXP2L'
dae[i]=(CAR(t)==R_NilValue)?0:SEXP2L(CAR(t));
^
Rengine.c: In function 'Java_org_rosuda_JRI_Rengine_rniStop':
Rengine.c:651:20: error: 'R_interrupts_pending' undeclared (first use in this function)
if (flag == 0) R_interrupts_pending = 1;
^
Rengine.c:651:20: note: each undeclared identifier is reported only once for each function it appears in
Rengine.c:652:5: warning: implicit declaration of function 'kill' [-Wimplicit-function-declaration]
else if (flag == 1) kill(getpid(), SIGINT);
^
Rengine.c:653:5: warning: implicit declaration of function 'Rf_onintr' [-Wimplicit-function-declaration]
else Rf_onintr();
^
make[1]: *
* [Rengine.o] Error 1
make: *** [src/jri.dll] Error 2

.jarray(..., dispatch=T) on multi-dimensional arrays creates Java objects with wrong content

Java passes R an array with dimensions [1:10, 1:20, 1:2] of doubles, none of which are zero. rJava shows the object having signature Java-Array-Object[D:[D@60f5d9a6 and .jevalArray with simplify=T returns a numeric array with the correct dimensions, but only element [1,1,] has values and all others are, incorrectly, zero.
Am I using .jevalArray correctly?

Also, I can use sapply(..., .jevalArray, simplify=T) and get back a list object with attr(*, "dim")= int [1:2] 20 10, the elements of which are the correct non-zero values; however, the sapply approach above is prohibitively slow for larger arrays, so I can't use it in this way.

The environment:

R version 3.0.2 (2013-09-25)
Platform: x86_64-pc-linux-gnu (64-bit)

locale:
 [1] LC_CTYPE=en_US.UTF-8          LC_NUMERIC=C                 
 [3] LC_TIME=en_US.UTF-8           LC_COLLATE=en_US.UTF-8       
 [5] LC_MONETARY=en_US.UTF-8       LC_MESSAGES=en_US.UTF-8      
 [7] LC_PAPER=en_US.UTF-8          LC_NAME=en_US.UTF-8          
 [9] LC_ADDRESS=en_US.UTF-8        LC_TELEPHONE=en_US.UTF-8     
[11] LC_MEASUREMENT=en_US.UTF-8    LC_IDENTIFICATION=en_US.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] ParticleBayes_0.1  rJava_0.9-6        devtools_1.3       rj_1.1.3-1        
[5] vimcom.plus_0.9-91 setwidth_1.0-3    

loaded via a namespace (and not attached):
 [1] digest_0.6.3   evaluate_0.5.1 httr_0.2       memoise_0.1    parallel_3.0.2
 [6] RCurl_1.95-4.1 rj.gd_1.1.3-1  stringr_0.6.2  tools_3.0.2    whisker_0.3-2 

R did not generate REngineEvalException on RTest

I am testing JRI using the RTest class in the org.rosuda.REngine.JRI.test package and I am getting the following error:

    rnorm(5); stop('error'); rnorm(2)Error: error
    Exception: org.rosuda.REngine.JRI.test.TestException: error in R did not generate REngineEvalException
    org.rosuda.REngine.JRI.test.TestException: error in R did not generate REngineEvalException at org.rosuda.REngine.JRI.test.RTest.main(RTest.java:283)

I tried to trace the error into the JRIEngine object and rni.Parse(text, -1) returns 139793149998072 and is compared with R_NilValue = 139793132433096 and 0 in order to check if it throws a REngineException.
I don't know what 139793149998072 means and how to fix this. Any hints?

setting CLASSPATH manually prevents rJava from finding getsp class for configure tests

Using the command > install.packages("rJava") fails with the message
... ...
checking Java support in R... present:
interpreter : '/usr/bin/java'
archiver : '/usr/bin/jar'
compiler : '/usr/bin/javac'
header prep.: '/usr/bin/javah'
cpp flags : '-I/usr/lib/jvm/java-7-openjdk-amd64/jre/../include'
java libs : '-L/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/server -ljvm'
checking whether Java run-time works... Error: Could not find or load main class getsp
no
configure: error: Java interpreter '/usr/bin/java' does not work
ERROR: configuration failed for package ‘rJava’

  • removing ‘/home/dario/R/x86_64-pc-linux-gnu-library/3.0/rJava’

I did $ sudo R CMD javareconf and reopened R, but this made no difference. I also clicked the link on the rJava homepage "If you have questions about installation, please visit the R Wiki - rJava package.", but the link is broken.

At the command line, Java is working fine :

dario@bioinfo:$ java -version
java version "1.7.0_25"
OpenJDK Runtime Environment (IcedTea 2.3.12) (7u25-2.3.12-4ubuntu3)
OpenJDK 64-Bit Server VM (build 23.7-b01, mixed mode)
dario@bioinfo:
$ which java
/usr/bin/java

Unloading rJava and/or restarting JVM

[Repost from this SO question].

I would like to use rJava in combination with mcparallel but obviously the JVM cannot be forked. Therefore a separate JVM instance needs to be initiated for each child process, e.g:

library(rJava)
library(parallel)
myfile <-  system.file("tests", "test_import.xlsx", package = "xlsx")

#This works:
mccollect(mcparallel({
  #Automatically initiates JVM in child
  xlsx::read.xlsx(myfile, 1)
}))

However the problem in my case is that the JVM has already been initiated in the (main) parent process as well. This makes it impossible to use rJava in the child process:

#init JVM in parent
.jinit()

#Doesn't work anymore
mccollect(mcparallel({
  xlsx::read.xlsx(myfile, 1)
}))

So what I really need is a way to shutdown/kill and restart the JVM in the child process. Simply detach("package:rJava", unload = TRUE) doesn't seem to do the trick. The force.init parameter doesn't seem to result in a restart either:

#Also doesn't work:
.jinit()
mccollect(mcparallel({
  .jinit(force.init = TRUE)
  xlsx::read.xlsx(myfile, 1)
}))

Is there some way I can forcefully shutdown/kill the JVM in order to reinitiate it in the child process?

Installation failing on R 3.1.0

* installing source package ‘rJava’ ...
** package ‘rJava’ successfully unpacked and MD5 sums checked
checking for gcc... gcc -std=gnu99
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc -std=gnu99 accepts -g... yes
checking for gcc -std=gnu99 option to accept ISO C89... none needed
checking how to run the C preprocessor... gcc -std=gnu99 -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/wait.h that is POSIX.1 compatible... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for string.h... (cached) yes
checking sys/time.h usability... yes
checking sys/time.h presence... yes
checking for sys/time.h... yes
checking for unistd.h... (cached) yes
checking for an ANSI C-conforming const... yes
checking whether time.h and sys/time.h may both be included... yes
configure: checking whether gcc -std=gnu99 supports static inline...
yes
checking whether setjmp.h is POSIX.1 compatible... yes
checking whether sigsetjmp is declared... yes
checking whether siglongjmp is declared... yes
checking Java support in R... present:
interpreter : '/usr/bin/java'
archiver : '/usr/bin/jar'
compiler : '/usr/bin/javac'
header prep.: '/usr/bin/javah'
cpp flags : '-I/usr/lib/jvm/java-6-openjdk-amd64/jre/../include'
java libs : '-L/usr/lib/jvm/java-6-openjdk-amd64/jre/lib/amd64/server -ljvm'
checking whether Java run-time works... yes
checking whether -Xrs is supported... yes
checking whether JNI programs can be compiled... yes
checking JNI data types... ok
checking whether JRI should be compiled (autodetect)... yes
checking whether debugging output should be enabled... no
checking whether memory profiling is desired... no
checking whether threads support is requested... no
checking whether callbacks support is requested... no
checking whether JNI cache support is requested... no
checking whether headless init is enabled... no
checking whether JRI is requested... yes
configure: creating ./config.status
config.status: creating src/Makevars
config.status: creating R/zzz.R
config.status: creating src/config.h
=== configuring in jri (/tmp/RtmpfEnBeU/R.INSTALL57bb5b186eda/rJava/jri)
configure: running /bin/bash ./configure --disable-option-checking '--prefix=/usr/local' --cache-file=/dev/null --srcdir=.
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking for gcc... gcc -std=gnu99
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc -std=gnu99 accepts -g... yes
checking for gcc -std=gnu99 option to accept ISO C89... none needed
checking how to run the C preprocessor... gcc -std=gnu99 -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking whether Java interpreter works... checking whether JNI programs can be compiled... yes
checking whether JNI programs can be run... yes
checking JNI data types... ok
checking whether Rinterface.h exports R_CStackXXX variables... yes
checking whether Rinterface.h exports R_SignalHandlers... yes
configure: creating ./config.status
config.status: creating src/Makefile
config.status: creating Makefile
config.status: creating run
config.status: creating src/config.h
** libs
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG -I. -I/usr/lib/jvm/java-6-openjdk-amd64/jre/../include -fpic -O3 -pipe -g -c Rglue.c -o Rglue.o
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG -I. -I/usr/lib/jvm/java-6-openjdk-amd64/jre/../include -fpic -O3 -pipe -g -c arrayc.c -o arrayc.o
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG -I. -I/usr/lib/jvm/java-6-openjdk-amd64/jre/../include -fpic -O3 -pipe -g -c callJNI.c -o callJNI.o
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG -I. -I/usr/lib/jvm/java-6-openjdk-amd64/jre/../include -fpic -O3 -pipe -g -c callback.c -o callback.o
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG -I. -I/usr/lib/jvm/java-6-openjdk-amd64/jre/../include -fpic -O3 -pipe -g -c fields.c -o fields.o
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG -I. -I/usr/lib/jvm/java-6-openjdk-amd64/jre/../include -fpic -O3 -pipe -g -c init.c -o init.o
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG -I. -I/usr/lib/jvm/java-6-openjdk-amd64/jre/../include -fpic -O3 -pipe -g -c jri_glue.c -o jri_glue.o
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG -I. -I/usr/lib/jvm/java-6-openjdk-amd64/jre/../include -fpic -O3 -pipe -g -c loader.c -o loader.o
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG -I. -I/usr/lib/jvm/java-6-openjdk-amd64/jre/../include -fpic -O3 -pipe -g -c otables.c -o otables.o
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG -I. -I/usr/lib/jvm/java-6-openjdk-amd64/jre/../include -fpic -O3 -pipe -g -c rJava.c -o rJava.o
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG -I. -I/usr/lib/jvm/java-6-openjdk-amd64/jre/../include -fpic -O3 -pipe -g -c tools.c -o tools.o
gcc -std=gnu99 -shared -o rJava.so Rglue.o arrayc.o callJNI.o callback.o fields.o init.o jri_glue.o loader.o otables.o rJava.o tools.o -L/usr/lib/jvm/java-6-openjdk-amd64/jre/lib/amd64/server -ljvm -L/usr/lib/R/lib -lR
(cd ../jri && make)
make[1]: Entering directory /tmp/RtmpfEnBeU/R.INSTALL57bb5b186eda/rJava/jri' make -C src JRI.jar make[2]: Entering directory/tmp/RtmpfEnBeU/R.INSTALL57bb5b186eda/rJava/jri/src'
/usr/bin/javac -target 1.4 -source 1.4 -d . ../Mutex.java ../RBool.java ../RConsoleOutputStream.java ../REXP.java ../RFactor.java ../RList.java ../RMainLoopCallbacks.java ../RVector.java ../Rengine.java ../package-info.java
/usr/bin/javah -d . -classpath . org.rosuda.JRI.Rengine
gcc -std=gnu99 -c -o Rengine.o Rengine.c -g -Iinclude -DRIF_HAS_CSTACK -DRIF_HAS_RSIGHAND -O3 -pipe -g -I/usr/lib/jvm/java-6-openjdk-amd64/jre/../include -fpic -I/usr/lib/jvm/java-6-openjdk-amd64/jre/../include -I/usr/share/R/include -I/usr/share/R/include
gcc -std=gnu99 -c -o jri.o jri.c -g -Iinclude -DRIF_HAS_CSTACK -DRIF_HAS_RSIGHAND -O3 -pipe -g -I/usr/lib/jvm/java-6-openjdk-amd64/jre/../include -fpic -I/usr/lib/jvm/java-6-openjdk-amd64/jre/../include -I/usr/share/R/include -I/usr/share/R/include
gcc -std=gnu99 -c -o Rcallbacks.o Rcallbacks.c -g -Iinclude -DRIF_HAS_CSTACK -DRIF_HAS_RSIGHAND -O3 -pipe -g -I/usr/lib/jvm/java-6-openjdk-amd64/jre/../include -fpic -I/usr/lib/jvm/java-6-openjdk-amd64/jre/../include -I/usr/share/R/include -I/usr/share/R/include
gcc -std=gnu99 -c -o Rinit.o Rinit.c -g -Iinclude -DRIF_HAS_CSTACK -DRIF_HAS_RSIGHAND -O3 -pipe -g -I/usr/lib/jvm/java-6-openjdk-amd64/jre/../include -fpic -I/usr/share/R/include -I/usr/share/R/include
gcc -std=gnu99 -c -o globals.o globals.c -g -Iinclude -DRIF_HAS_CSTACK -DRIF_HAS_RSIGHAND -O3 -pipe -g -I/usr/lib/jvm/java-6-openjdk-amd64/jre/../include -fpic -I/usr/lib/jvm/java-6-openjdk-amd64/jre/../include
gcc -std=gnu99 -c -o rjava.o rjava.c -g -Iinclude -DRIF_HAS_CSTACK -DRIF_HAS_RSIGHAND -O3 -pipe -g -I/usr/lib/jvm/java-6-openjdk-amd64/jre/../include -fpic -I/usr/lib/jvm/java-6-openjdk-amd64/jre/../include
rjava.c: In function ‘RJava_init_ctrl’:
rjava.c:51:8: warning: ignoring return value of ‘write’, declared with attribute warn_unused_result [-Wunused-result]
rjava.c:52:7: warning: ignoring return value of ‘read’, declared with attribute warn_unused_result [-Wunused-result]
rjava.c: In function ‘RJava_request_callback’:
rjava.c:39:8: warning: ignoring return value of ‘write’, declared with attribute warn_unused_result [-Wunused-result]
rjava.c: In function ‘RJava_clear_lock’:
rjava.c:30:8: warning: ignoring return value of ‘write’, declared with attribute warn_unused_result [-Wunused-result]
rjava.c: In function ‘RJava_request_lock’:
rjava.c:22:8: warning: ignoring return value of ‘write’, declared with attribute warn_unused_result [-Wunused-result]
gcc -std=gnu99 -o libjri.so Rengine.o jri.o Rcallbacks.o Rinit.o globals.o rjava.o -shared -L/usr/lib/jvm/java-6-openjdk-amd64/jre/lib/amd64/server -ljvm -Wl,--export-dynamic -fopenmp -L/usr/lib/R/lib -lR -lpcre -llzma -lbz2 -lrt -ldl -lm
/usr/bin/ld: cannot find -llzma
collect2: ld returned 1 exit status
make[2]: *** [libjri.so] Error 1
make[2]: Leaving directory /tmp/RtmpfEnBeU/R.INSTALL57bb5b186eda/rJava/jri/src' make[1]: *** [src/JRI.jar] Error 2 make[1]: Leaving directory/tmp/RtmpfEnBeU/R.INSTALL57bb5b186eda/rJava/jri'
make: *** [jri] Error 2
ERROR: compilation failed for package ‘rJava’

  • removing ‘/home/cohen/R/x86_64-pc-linux-gnu-library/3.1/rJava’

The downloaded source packages are in
‘/tmp/RtmpGTuZNb/downloaded_packages’
Warning message:
In install.packages("rJava", dependencies = T) :
installation of package ‘rJava’ had non-zero exit status

installation failing on Ubuntu 12.04, unable to load rJava.so

I know there is an ubuntu package for rjava but xlsxjars seems to need a newer version so I tried installing from source,but get the following error:

install.packages("rJava")
Installing package into ‘/home/shackle/R/i686-pc-linux-gnu-library/3.1’
(as ‘lib’ is unspecified)
trying URL 'http://cran.rstudio.com/src/contrib/rJava_0.9-6.tar.gz'
Content type 'application/x-gzip' length 567515 bytes (554 Kb)

opened URL

downloaded 554 Kb

  • installing source package ‘rJava’ ...
    ** package ‘rJava’ successfully unpacked and MD5 sums checked
    checking for gcc... gcc -std=gnu99
    checking whether the C compiler works... yes
    checking for C compiler default output file name... a.out
    checking for suffix of executables...
    checking whether we are cross compiling... no
    checking for suffix of object files... o
    checking whether we are using the GNU C compiler... yes
    checking whether gcc -std=gnu99 accepts -g... yes
    checking for gcc -std=gnu99 option to accept ISO C89... none needed
    checking how to run the C preprocessor... gcc -std=gnu99 -E
    checking for grep that handles long lines and -e... /bin/grep
    checking for egrep... /bin/grep -E
    checking for ANSI C header files... yes
    checking for sys/wait.h that is POSIX.1 compatible... yes
    checking for sys/types.h... yes
    checking for sys/stat.h... yes
    checking for stdlib.h... yes
    checking for string.h... yes
    checking for memory.h... yes
    checking for strings.h... yes
    checking for inttypes.h... yes
    checking for stdint.h... yes
    checking for unistd.h... yes
    checking for string.h... (cached) yes
    checking sys/time.h usability... yes
    checking sys/time.h presence... yes
    checking for sys/time.h... yes
    checking for unistd.h... (cached) yes
    checking for an ANSI C-conforming const... yes
    checking whether time.h and sys/time.h may both be included... yes
    configure: checking whether gcc -std=gnu99 supports static inline...
    yes
    checking whether setjmp.h is POSIX.1 compatible... yes
    checking whether sigsetjmp is declared... yes
    checking whether siglongjmp is declared... yes
    checking Java support in R... present:
    interpreter : '/usr/bin/java'
    archiver : '/usr/bin/jar'
    compiler : '/usr/bin/javac'
    header prep.: '/usr/bin/javah'
    cpp flags : '-I/usr/lib/jvm/java-6-openjdk-i386/jre/../include'
    java libs : '-L/usr/lib/jvm/java-6-openjdk-i386/jre/lib/i386/client -ljvm'
    checking whether Java run-time works... yes
    checking whether -Xrs is supported... yes
    checking whether JNI programs can be compiled... yes
    checking JNI data types... ok
    checking whether JRI should be compiled (autodetect)... yes
    checking whether debugging output should be enabled... no
    checking whether memory profiling is desired... no
    checking whether threads support is requested... no
    checking whether callbacks support is requested... no
    checking whether JNI cache support is requested... no
    checking whether headless init is enabled... no
    checking whether JRI is requested... yes
    configure: creating ./config.status
    config.status: creating src/Makevars
    config.status: creating R/zzz.R
    config.status: creating src/config.h
    === configuring in jri (/tmp/RtmpVXJGba/R.INSTALL61856edb66de/rJava/jri)
    configure: running /bin/sh ./configure --disable-option-checking '--prefix=/usr/local' --cache-file=/dev/null --srcdir=.
    checking build system type... i686-pc-linux-gnu
    checking host system type... i686-pc-linux-gnu
    checking for gcc... gcc -std=gnu99
    checking for C compiler default output file name... a.out
    checking whether the C compiler works... yes
    checking whether we are cross compiling... no
    checking for suffix of executables...
    checking for suffix of object files... o
    checking whether we are using the GNU C compiler... yes
    checking whether gcc -std=gnu99 accepts -g... yes
    checking for gcc -std=gnu99 option to accept ISO C89... none needed
    checking how to run the C preprocessor... gcc -std=gnu99 -E
    checking for grep that handles long lines and -e... /bin/grep
    checking for egrep... /bin/grep -E
    checking for ANSI C header files... yes
    checking whether Java interpreter works... checking whether JNI programs can be compiled... yes
    checking whether JNI programs can be run... yes
    checking JNI data types... ok
    checking whether Rinterface.h exports R_CStackXXX variables... yes
    checking whether Rinterface.h exports R_SignalHandlers... yes
    configure: creating ./config.status
    config.status: creating src/Makefile
    config.status: creating Makefile
    config.status: creating run
    config.status: creating src/config.h
    ** libs
    gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG -I. -I/usr/lib/jvm/java-6-openjdk-i386/jre/../include -fpic -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -g -c Rglue.c -o Rglue.o
    gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG -I. -I/usr/lib/jvm/java-6-openjdk-i386/jre/../include -fpic -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -g -c arrayc.c -o arrayc.o
    gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG -I. -I/usr/lib/jvm/java-6-openjdk-i386/jre/../include -fpic -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -g -c callJNI.c -o callJNI.o
    gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG -I. -I/usr/lib/jvm/java-6-openjdk-i386/jre/../include -fpic -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -g -c callback.c -o callback.o
    gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG -I. -I/usr/lib/jvm/java-6-openjdk-i386/jre/../include -fpic -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -g -c fields.c -o fields.o
    gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG -I. -I/usr/lib/jvm/java-6-openjdk-i386/jre/../include -fpic -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -g -c init.c -o init.o
    gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG -I. -I/usr/lib/jvm/java-6-openjdk-i386/jre/../include -fpic -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -g -c jri_glue.c -o jri_glue.o
    jri_glue.c: In function ‘PushToREXP’:
    jri_glue.c:24:15: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
    jri_glue.c: In function ‘RReleaseREXP’:
    jri_glue.c:52:11: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG -I. -I/usr/lib/jvm/java-6-openjdk-i386/jre/../include -fpic -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -g -c loader.c -o loader.o
    gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG -I. -I/usr/lib/jvm/java-6-openjdk-i386/jre/../include -fpic -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -g -c otables.c -o otables.o
    gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG -I. -I/usr/lib/jvm/java-6-openjdk-i386/jre/../include -fpic -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -g -c rJava.c -o rJava.o
    gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG -I. -I/usr/lib/jvm/java-6-openjdk-i386/jre/../include -fpic -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -g -c tools.c -o tools.o
    gcc -std=gnu99 -shared -Wl,-Bsymbolic-functions -Wl,-z,relro -o rJava.so Rglue.o arrayc.o callJNI.o callback.o fields.o init.o jri_glue.o loader.o otables.o rJava.o tools.o -L/usr/lib/jvm/java-6-openjdk-i386/jre/lib/i386/client -ljvm -L/usr/lib/R/lib -lR
    (cd ../jri && make)
    make[1]: Entering directory /tmp/RtmpVXJGba/R.INSTALL61856edb66de/rJava/jri' make -C src JRI.jar make[2]: Entering directory/tmp/RtmpVXJGba/R.INSTALL61856edb66de/rJava/jri/src'
    /usr/bin/javac -target 1.4 -source 1.4 -d . ../Mutex.java ../RBool.java ../RConsoleOutputStream.java ../REXP.java ../RFactor.java ../RList.java ../RMainLoopCallbacks.java ../RVector.java ../Rengine.java ../package-info.java
    warning: [options] bootstrap class path not set in conjunction with -source 1.4
    1 warning
    /usr/bin/javah -d . -classpath . org.rosuda.JRI.Rengine
    gcc -std=gnu99 -c -o Rengine.o Rengine.c -g -Iinclude -DRIF_HAS_CSTACK -DRIF_HAS_RSIGHAND -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -g -I/usr/lib/jvm/java-6-openjdk-i386/jre/../include -fpic -I/usr/lib/jvm/java-6-openjdk-i386/jre/../include -I/usr/share/R/include -I/usr/share/R/include
    Rengine.c: In function ‘Java_org_rosuda_JRI_Rengine_rniParse’:
    Rengine.c:121:14: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
    Rengine.c: In function ‘Java_org_rosuda_JRI_Rengine_rniEval’:
    Rengine.c:135:36: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    Rengine.c:136:23: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    Rengine.c:159:14: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
    Rengine.c: In function ‘Java_org_rosuda_JRI_Rengine_rniAssign’:
    Rengine.c:179:20: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    Rengine.c:180:20: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    Rengine.c: In function ‘Java_org_rosuda_JRI_Rengine_rniProtect’:
    Rengine.c:189:2: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    Rengine.c: In function ‘Java_org_rosuda_JRI_Rengine_rniRelease’:
    Rengine.c:201:27: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    Rengine.c: In function ‘Java_org_rosuda_JRI_Rengine_rniPreserve’:
    Rengine.c:207:28: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    Rengine.c: In function ‘Java_org_rosuda_JRI_Rengine_rniPrintValue’:
    Rengine.c:213:22: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    Rengine.c: In function ‘Java_org_rosuda_JRI_Rengine_rniParentEnv’:
    Rengine.c:219:10: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    Rengine.c:219:10: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
    Rengine.c: In function ‘Java_org_rosuda_JRI_Rengine_rniFindVar’:
    Rengine.c:228:9: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    Rengine.c:228:9: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
    Rengine.c: In function ‘Java_org_rosuda_JRI_Rengine_rniListEnv’:
    Rengine.c:234:9: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    Rengine.c:234:9: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
    Rengine.c: In function ‘Java_org_rosuda_JRI_Rengine_rniSpecialObject’:
    Rengine.c:241:18: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
    Rengine.c:242:18: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
    Rengine.c:243:18: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
    Rengine.c:244:18: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
    Rengine.c:245:18: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
    Rengine.c:246:18: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
    Rengine.c:247:18: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
    Rengine.c:248:18: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
    Rengine.c: In function ‘Java_org_rosuda_JRI_Rengine_rniXrefToJava’:
    Rengine.c:256:12: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    Rengine.c: In function ‘Java_org_rosuda_JRI_Rengine_rniJavaToXref’:
    Rengine.c:266:10: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
    Rengine.c: In function ‘Java_org_rosuda_JRI_Rengine_rniGetString’:
    Rengine.c:272:33: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    Rengine.c: In function ‘Java_org_rosuda_JRI_Rengine_rniGetStringArray’:
    Rengine.c:279:38: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    Rengine.c: In function ‘Java_org_rosuda_JRI_Rengine_rniGetIntArray’:
    Rengine.c:285:35: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    Rengine.c: In function ‘Java_org_rosuda_JRI_Rengine_rniGetRawArray’:
    Rengine.c:291:36: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    Rengine.c: In function ‘Java_org_rosuda_JRI_Rengine_rniGetBoolArrayI’:
    Rengine.c:297:37: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    Rengine.c: In function ‘Java_org_rosuda_JRI_Rengine_rniGetDoubleArray’:
    Rengine.c:303:38: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    Rengine.c: In function ‘Java_org_rosuda_JRI_Rengine_rniGetVector’:
    Rengine.c:309:35: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    Rengine.c: In function ‘Java_org_rosuda_JRI_Rengine_rniExpType’:
    Rengine.c:315:25: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    Rengine.c: In function ‘Java_org_rosuda_JRI_Rengine_rniPutString’:
    Rengine.c:335:12: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
    Rengine.c: In function ‘Java_org_rosuda_JRI_Rengine_rniPutStringArray’:
    Rengine.c:341:12: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
    Rengine.c: In function ‘Java_org_rosuda_JRI_Rengine_rniPutIntArray’:
    Rengine.c:347:12: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
    Rengine.c: In function ‘Java_org_rosuda_JRI_Rengine_rniPutRawArray’:
    Rengine.c:353:12: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
    Rengine.c: In function ‘Java_org_rosuda_JRI_Rengine_rniPutBoolArrayI’:
    Rengine.c:359:12: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
    Rengine.c: In function ‘Java_org_rosuda_JRI_Rengine_rniPutBoolArray’:
    Rengine.c:365:12: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
    Rengine.c: In function ‘Java_org_rosuda_JRI_Rengine_rniPutDoubleArray’:
    Rengine.c:371:12: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
    Rengine.c: In function ‘Java_org_rosuda_JRI_Rengine_rniPutVector’:
    Rengine.c:377:12: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
    Rengine.c: In function ‘Java_org_rosuda_JRI_Rengine_rniGetAttr’:
    Rengine.c:384:44: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    Rengine.c:386:28: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    Rengine.c:387:34: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
    Rengine.c: In function ‘Java_org_rosuda_JRI_Rengine_rniGetAttrNames’:
    Rengine.c:394:14: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    Rengine.c: In function ‘Java_org_rosuda_JRI_Rengine_rniSetAttr’:
    Rengine.c:426:44: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    Rengine.c:428:15: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    Rengine.c:428:53: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    Rengine.c: In function ‘Java_org_rosuda_JRI_Rengine_rniInstallSymbol’:
    Rengine.c:441:12: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
    Rengine.c: In function ‘Java_org_rosuda_JRI_Rengine_rniGetSymbolName’:
    Rengine.c:447:32: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    Rengine.c: In function ‘Java_org_rosuda_JRI_Rengine_rniInherits’:
    Rengine.c:457:16: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    Rengine.c: In function ‘Java_org_rosuda_JRI_Rengine_rniCons’:
    Rengine.c:468:9: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    Rengine.c:468:9: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    Rengine.c:470:9: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    Rengine.c:470:9: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    Rengine.c:472:23: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    Rengine.c:473:10: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
    Rengine.c: In function ‘Java_org_rosuda_JRI_Rengine_rniCAR’:
    Rengine.c:480:22: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    Rengine.c:481:34: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
    Rengine.c: In function ‘Java_org_rosuda_JRI_Rengine_rniCDR’:
    Rengine.c:490:22: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    Rengine.c:491:34: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
    Rengine.c: In function ‘Java_org_rosuda_JRI_Rengine_rniTAG’:
    Rengine.c:500:22: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    Rengine.c:501:34: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
    Rengine.c: In function ‘Java_org_rosuda_JRI_Rengine_rniPutList’:
    Rengine.c:516:21: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
    Rengine.c:521:11: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    Rengine.c:526:12: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
    Rengine.c: In function ‘Java_org_rosuda_JRI_Rengine_rniGetList’:
    Rengine.c:533:12: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    Rengine.c:560:51: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
    gcc -std=gnu99 -c -o jri.o jri.c -g -Iinclude -DRIF_HAS_CSTACK -DRIF_HAS_RSIGHAND -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -g -I/usr/lib/jvm/java-6-openjdk-i386/jre/../include -fpic -I/usr/lib/jvm/java-6-openjdk-i386/jre/../include -I/usr/share/R/include -I/usr/share/R/include
    jri.c: In function ‘jri_putSEXPLArray’:
    jri.c:193:26: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
    jri.c: In function ‘jri_getObjectArray’:
    jri.c:308:27: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
    jri.c: In function ‘jri_getSEXPLArray’:
    jri.c:472:31: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    gcc -std=gnu99 -c -o Rcallbacks.o Rcallbacks.c -g -Iinclude -DRIF_HAS_CSTACK -DRIF_HAS_RSIGHAND -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -g -I/usr/lib/jvm/java-6-openjdk-i386/jre/../include -fpic -I/usr/lib/jvm/java-6-openjdk-i386/jre/../include -I/usr/share/R/include -I/usr/share/R/include
    gcc -std=gnu99 -c -o Rinit.o Rinit.c -g -Iinclude -DRIF_HAS_CSTACK -DRIF_HAS_RSIGHAND -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -g -I/usr/lib/jvm/java-6-openjdk-i386/jre/../include -fpic -I/usr/share/R/include -I/usr/share/R/include
    gcc -std=gnu99 -c -o globals.o globals.c -g -Iinclude -DRIF_HAS_CSTACK -DRIF_HAS_RSIGHAND -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -g -I/usr/lib/jvm/java-6-openjdk-i386/jre/../include -fpic -I/usr/lib/jvm/java-6-openjdk-i386/jre/../include
    gcc -std=gnu99 -c -o rjava.o rjava.c -g -Iinclude -DRIF_HAS_CSTACK -DRIF_HAS_RSIGHAND -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -g -I/usr/lib/jvm/java-6-openjdk-i386/jre/../include -fpic -I/usr/lib/jvm/java-6-openjdk-i386/jre/../include
    rjava.c: In function ‘RJava_init_ctrl’:
    rjava.c:51:8: warning: ignoring return value of ‘write’, declared with attribute warn_unused_result [-Wunused-result]
    rjava.c:52:7: warning: ignoring return value of ‘read’, declared with attribute warn_unused_result [-Wunused-result]
    rjava.c: In function ‘RJava_request_callback’:
    rjava.c:39:8: warning: ignoring return value of ‘write’, declared with attribute warn_unused_result [-Wunused-result]
    rjava.c: In function ‘RJava_clear_lock’:
    rjava.c:30:8: warning: ignoring return value of ‘write’, declared with attribute warn_unused_result [-Wunused-result]
    rjava.c: In function ‘RJava_request_lock’:
    rjava.c:22:8: warning: ignoring return value of ‘write’, declared with attribute warn_unused_result [-Wunused-result]
    gcc -std=gnu99 -o libjri.so Rengine.o jri.o Rcallbacks.o Rinit.o globals.o rjava.o -shared -L/usr/lib/jvm/java-6-openjdk-i386/jre/lib/i386/client -ljvm -Wl,--export-dynamic -fopenmp -L/usr/lib/R/lib -lR -lpcre -llzma -lbz2 -lrt -ldl -lm
    /usr/bin/javac -target 1.4 -source 1.4 -d . ../Mutex.java ../RBool.java ../RConsoleOutputStream.java ../REXP.java ../RFactor.java ../RList.java ../RMainLoopCallbacks.java ../RVector.java ../Rengine.java ../package-info.java
    warning: [options] bootstrap class path not set in conjunction with -source 1.4
    1 warning
    /usr/bin/jar fc JRI.jar org libjri.so
    make[2]: Leaving directory /tmp/RtmpVXJGba/R.INSTALL61856edb66de/rJava/jri/src' rm -f libjri.so cp src/libjri.so libjri.so /usr/bin/javac -target 1.4 -source 1.4 -classpath src/JRI.jar -d examples examples/rtest.java warning: [options] bootstrap class path not set in conjunction with -source 1.4 Note: examples/rtest.java uses or overrides a deprecated API. Note: Recompile with -Xlint:deprecation for details. 1 warning /usr/bin/javac -target 1.4 -source 1.4 -classpath src/JRI.jar -d examples examples/rtest2.java warning: [options] bootstrap class path not set in conjunction with -source 1.4 Note: examples/rtest2.java uses or overrides a deprecated API. Note: Recompile with -Xlint:deprecation for details. 1 warning make[1]: Leaving directory/tmp/RtmpVXJGba/R.INSTALL61856edb66de/rJava/jri'
    installing via 'install.libs.R' to /home/shackle/R/i686-pc-linux-gnu-library/3.1/rJava
    ** R
    ** inst
    ** preparing package for lazy loading
    ** help
    *** installing help indices
    ** building package indices
    ** testing if installed package can be loaded
    Error : .onLoad failed in loadNamespace() for 'rJava', details:
    call: dyn.load(file, DLLpath = DLLpath, ...)
    error: unable to load shared object '/home/shackle/R/i686-pc-linux-gnu-library/3.1/rJava/libs/rJava.so':
    libjvm.so: cannot open shared object file: No such file or directory
    Error: loading failed
    Execution halted
    ERROR: loading failed
  • removing ‘/home/shackle/R/i686-pc-linux-gnu-library/3.1/rJava’
    Warning in install.packages :
    installation of package ‘rJava’ had non-zero exit status

The downloaded source packages are in
‘/tmp/RtmpHqf4OL/downloaded_packages’

version
_
platform i686-pc-linux-gnu
arch i686
os linux-gnu
system i686, linux-gnu
status
major 3
minor 1.0
year 2014
month 04
day 10
svn rev 65387
language R
version.string R version 3.1.0 (2014-04-10)
nickname Spring Dance

R Studio crashes when installing rJava Package

Java 1.70_76-b13
Mac OS Yosemite 10.10.2
R Studio 0.98.10.91
When loading the rJava library it produces a fatal error saying that RStudio needs an older version of Java execution runtime: SE 6. As I have other applications requiring SE 7, I don't want to come back to the older Java Runtime . Any idea about how to overcome this? Thanks in advance
JB

Minimum Java requirememt

Hello,

I need to install rJava in a headless server running ubuntu. When intalling the package ifrom the distributuion it pulls many packages related to the graphical interface:

acl at-spi2-core ca-certificates-java colord dbus-x11 dconf-gsettings-backend dconf-service default-jre
  default-jre-headless desktop-file-utils fonts-dejavu-extra gconf-service gconf-service-backend gconf2
  gconf2-common gvfs gvfs-common gvfs-daemons gvfs-libs hicolor-icon-theme icedtea-7-jre-jamvm init-system-helpers
  java-common libasound2 libasound2-data libasyncns0 libatasmart4 libatk-bridge2.0-0 libatk-wrapper-java
  libatk-wrapper-java-jni libatk1.0-0 libatk1.0-data libatspi2.0-0 libavahi-glib1 libbonobo2-0 libbonobo2-common
  libcairo-gobject2 libcanberra0 libcolord1 libcolorhug1 libdconf1 libexif12 libflac8 libgconf-2-4 libgconf2-4
  libgdk-pixbuf2.0-0 libgdk-pixbuf2.0-common libgnome2-0 libgnome2-bin libgnome2-common libgnomevfs2-0
  libgnomevfs2-common libgphoto2-6 libgphoto2-l10n libgphoto2-port10 libgtk-3-0 libgtk-3-bin libgtk-3-common
  libgtk2.0-0 libgtk2.0-bin libgtk2.0-common libgudev-1.0-0 libgusb2 libidl-common libidl0 libieee1284-3 libogg0
  liborbit2 libpulse0 libsane libsane-common libsecret-1-0 libsecret-common libsndfile1 libudisks2-0 libv4l-0
  libv4lconvert0 libvorbis0a libvorbisenc2 libvorbisfile3 libwayland-client0 libwayland-cursor0 libxkbcommon0
  openjdk-7-jre openjdk-7-jre-headless policykit-1-gnome r-cran-rjava sound-theme-freedesktop tzdata-java udisks2

I would like to have the option to avoid all these dependencies. Is it a matter of packaging or rJava really depends on e.g. gtk? It would be great to have headless version.

R call Java Error (which new REngine in Java)

I could call R from Java and call Java function from R successfully both.
However, when I'm trying to use rJava JRI to call Java from R, and Java code instance new REngine. It failed reports
R is already initialized
and then quit R directly.

My class:
public class testRJava {
public void testOK(){
System.out.println("test this funciton could be called OK");
}
public void callSample(){
Rengine re = Rengine.getMainEngine();
if(re == null){
re=new Rengine (new String [] {"--vanilla"}, false, null);
if (!re.waitForR())
{
System.out.println ("Cannot load R");
return;
}
}
// print a random number from uniform distribution
System.out.println (re.eval ("runif(100)").asDouble());
re.end();
}
}

then, I call the Jar from R

b <- .jnew("testRJava")
b$testOK()
test this funciton could be called OK
b$
b$callSample() b$main( b$wait() b$toString() b$getClass() b$notifyAll()
b$testOK() b$wait( b$equals( b$hashCode() b$notify()
b$callSample()
R is already initialized
[root@ home]#

Do you know why? Any solution about this error ?

Can't find local class since R 3.2.0

Hi
I installed rJava on Yosemite following these instructions
http://andrewgoldstone.com/blog/2015/02/03/rjava/

which means I have both Oracle java 1.8 and the apple version, 1.6. Everything worked until I installed R 3.2. Now jfindClass doesn't find a class that I know is there (because it did work and because I checked with jar) It appears rJava is picking up 1.6

J("java.lang.System")$getProperty("java.version")
[1] "1.6.0_65"

This is unexpected. Installing 1.6 was supposed to be a workaround for a 1.8 bug, but it should be using the more recent version.
I did a javareconf, but it doesn't solve the issue. I tried to build rJava from source, but it can't find javac. It seems like there is an additional "jre" in the path it is using to access javac. java and javac are on the search path (1.8 version). If I change java home, I can get the build past the javac problem, but then it fails with "One or more JNI types differ from the corresponding native type. You may need to use non-standard compiler flags or a different compiler in order to fix this."

The rub is that to reproduce the process that worked, I need to uninstall the second java I installed. Opinions on how to achieve that are many. Any suggestions?

Multiple Rengine objects per JVM

I'm running JUnit tests against some code that leverages JRI to load and run some R scripts. Each unit test creates an Rengine object, loads a script and runs it, checks the output, then calls Rengine.end(). Unfortunately, only the first instance of the Rengine seems to work. Depending on the version of R, any Rengine instance created after the first Rengine.end() will either hang the JVM or no be able to source the scripts I want to test.

public void testR()
{
    Rengine r = new Rengine( new String[]{ "--no-save" }, false, null );
    r.eval( "setwd(\"C:/temp/\")" );
    REXP rexp = r.eval( "getwd()" );
    System.out.println( "rexp = " + rexp );
    rexp = r.eval( "source(\"calcBeta.R\")" );
    System.out.println( "rexp = " + rexp );
    r.end();

    r = new Rengine( new String[]{ "--no-save" }, false, null );
    r.eval( "setwd(\"C:/temp/\")" );
    rexp = r.eval( "getwd()" );
    System.out.println( "rexp = " + rexp );
    rexp = r.eval( "source(\"calcBeta.R\")" );
    System.out.println( "rexp = " + rexp );
    r.end();
}

If run against R 3.0.1 in windows, the second engine instance will return null when sourcing the script. When run against R 3.1.3 or later, it will just hang when trying to instantiate the second Rengine. Both are running using rJava 0.9-6

Is there a preferred way to shutdown the Rengine object to allow a new one to be instantiated within the same JVM?

Thanks

JRI ./configure cannot locate JAVA_LIBS correctly

Hi Simon,

While configuring JRI separately I am getting:

collect2: error: ld returned 1 exit status
configure:3829: $? = 1
configure: failed program was:
| 
| #include <jni.h>
| int main(void) {
|     jobject o;
|     return 0;
| }
| 
configure:3843: error: Cannot compile a simple JNI program. See config.log for details.

due to the fact that java -classpath tools getsp -libs doesn't return the correct lib path:

/usr/bin/java -classpath tools getsp -libs
-L/usr/java/packages/lib/amd64 -L/usr/lib/x86_64-linux-gnu/jni -L/lib/x86_64-linux-gnu -L/usr/lib/x86_64-linux-gnu -L/usr/lib/jni -L/lib -L/usr/lib

But my location (Ubuntu 14.10) is

~$ locate libjvm.so 
/usr/lib/debug/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/server/libjvm.so
/usr/lib/debug/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/zero/libjvm.so
/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/server/libjvm.so
/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/zero/libjvm.so

configure from rJava goes through. And R CMD javareconf finds the location correctly as well. So I guess my openjdk instalation is standard.

A side question. I see that now rJava, rServe, and rEngine are all separate projects on github, but not JRI. Would it be possible to move JRI to github as well?

Thanks.

Versioning scheme

This is probabley a trivial issue, but could you please use a scheme that most R package authors have been using (x.y.z)?

package or namespace load failed for ‘rJava’

Hi,
I am trying to load the rJava package in R and get the error shown below.

Just a note: I have Windows 8.1, already installed Java SDK and Java for Windows 8 with update 45, installed R 2 and I'm using R Studio latest version. Updated the System path to include the bin directory where Java SDK was installed, tested it successfully via the Command prompt. Downloaded the latest package of rJava_0.9-7.zip and unzip the files in the R Working directory and in the win 3.2 directory that R goes to when it runs the library(rJava) command.

But nothing seems to work. If anyone has a solution to the issues below, please let me know at [email protected]. Thank you!

install.packages("rJava")
Installing package into ‘C:/Users/Sandra/Documents/R/win-library/3.2’
(as ‘lib’ is unspecified)
trying URL 'http://cran.rstudio.com/bin/windows/contrib/3.2/rJava_0.9-6.zip'
Content type 'application/zip' length 761928 bytes (744 KB)
downloaded 744 KB

package ‘rJava’ successfully unpacked and MD5 sums checked

The downloaded binary packages are in
C:\Users\Sandra\AppData\Local\Temp\RtmpkxFfsn\downloaded_packages

library(rJava)
Error : .onLoad failed in loadNamespace() for 'rJava', details:
call: inDL(x, as.logical(local), as.logical(now), ...)
error: unable to load shared object 'C:/Users/Sandra/Documents/R/win-library/3.2/rJava/libs/x64/rJava.dll':
LoadLibrary failure: The specified module could not be found.

Error: package or namespace load failed for ‘rJava’

Call Java on the same JVM that opened the R instance

Is it possible to call Java from inside R using the same JVM from which you open R?
I want to open R from inside Java, then be able to alter Java objects from R code. I haven't tried it yet, I am just wondering if it is possible to do this with rJava and JRI.

Unable to load local Class

When attempting to use cloudera CDH 5.0, hive 0.12 with rJDBC we see the following error:

Error in .jcall(drv@jdrv, "Ljava/sql/Connection;", "connect", as.character(url)[1], :
java.lang.NoClassDefFoundError: Could not initialize class org.apache.hadoop.hive.conf.HiveConf$ConfVars

I have validated multiple times that the listed class is indeed in my class path as it is a part of hive-common.jar. You can see the source here:
https://github.com/cloudera/hive/blob/trunk/common/src/java/org/apache/hadoop/hive/conf/HiveConf.java

I'm trying to debug what may be causing this any help would greatly be appreciated.

R environment:
R version 3.0.3 (2014-03-06)
Platform: x86_64-pc-linux-gnu (64-bit) (ubuntu 12.04)
RJDBC_0.2-4
rJava_0.9-7
DBI_0.2-7

R code used:
library(DBI)
library(rJava)
library(RJDBC)

cp <- c(
"/opt/cloudera/parcels/CDH/lib/hive/lib/libthrift-0.9.0.cloudera.2.jar",
"/opt/cloudera/parcels/CDH/lib/hive/lib/libfb303-0.9.0.jar",
"/opt/cloudera/parcels/CDH/lib/hive/lib/hive-service.jar",
"/opt/cloudera/parcels/CDH/lib/hive/lib/hive-common.jar",
"/opt/cloudera/parcels/CDH/lib/hive/lib/hive-metastore.jar",
"/opt/cloudera/parcels/CDH/lib/hive/lib/hive-shims-common.jar",
"/opt/cloudera/parcels/CDH/lib/hive/lib/hive-shims.jar",
"/opt/cloudera/parcels/CDH/lib/hive/lib/httpclient-4.2.5.jar",
"/opt/cloudera/parcels/CDH/lib/hive/lib/httpcore-4.2.5.jar",
"/opt/cloudera//parcels/CDH/lib/hive/lib/hive-cli.jar",
"/opt/cloudera//parcels/CDH/lib/hive/lib/hive-contrib.jar",
"/opt/cloudera//parcels/CDH/lib/hive/lib/hive-beeline.jar",
"/opt/cloudera//parcels/CDH/lib/hive/lib/hive-jdbc.jar"

)

.jinit(classpath=cp)
drv <-JDBC("org.apache.hive.jdbc.HiveDriver", "hive-jdbc.jar", "`")
conn <-dbConnect(drv, "jdbc:hive2://<hiveserver2_host>:10000/default", "hdfs", "hdfs")

"No Java runtime" error in OS X 10.10 using Oracle's 1.8.0 JVM

I've tried 3 different Macs running OS X 10.10, R 3.1.2, Java 1.8.0_25, and rJava 0.9-7. In all three cases rJava installs from source without error but after running .jinit(), fails to detect Java and prompts to install Java 6 from apple. Another researcher at my institution reports the same issue.

I've spent hours researching online, but haven't yet found a solution and tried various things like manually setting JAVA_HOME and LD_LIBRARY_PATH to no avail.

R CMD javareconf
Java interpreter : /usr/bin/java
Java version : 1.8.0_25
Java home path : /Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk/Contents/Home/jre
Java compiler : /usr/bin/javac
Java headers gen.: /usr/bin/javah
Java archive tool: /usr/bin/jar
...

~ % echo $JAVA_HOME
/Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk/Contents/Home/jre
~ % echo $LD_LIBRARY_PATH
/Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk/Contents/Home/jre/lib/server

~ % R CMD INSTALL rJava_0.9-7.tar.gz

full compile output

~ % R

library('rJava')
.jinit()
No Java runtime present, requesting install.

.jsimplify fails to convert minimal Integer value

Hi,

Converting Java integer with minimal possible value (-2147483648) to R returns NA instead of the correct value:

value
[1] "Java-Object{-2147483648}"
.jsimplify(value)
[1] NA

Environment:
Ubuntu 14.04 64 bit
R version 3.0.2 (2013-09-25)
rJava version 0.9-6
java version "1.7.0_65"
OpenJDK Runtime Environment (IcedTea 2.5.3) (7u71-2.5.3-0ubuntu0.14.04.1)
OpenJDK 64-Bit Server VM (build 24.65-b04, mixed mode)

Libraries (.jar) files

Hi,

I am aware this is a noobish question, but are there any Java libraries (.jar) that I can add as dependencies to my project?

I looked through the repository and couldn't find them. I found C source files and Java source files.

Thanks and sorry if you happen to find the question offensively noobish.

Alex

how to use rJava with JDK 7

Hi,

Using OSX and R version 3.0.2 and rJava_0.9-6 installed via "

install.packages("rJava", type="source”)

and trying to use a jar that requires jdk 7. JAVA_HOME points to
/Library/Java/JavaVirtualMachines/jdk1.7.0_40.jdk/Contents/Home

and java -fullversion returns: "1.7.0_40-b43"

But I get Unsupported major.minor version 51.0 when use my jar.

I am guessing I need to get the jni stuff in rJava built with jdk 7 but Apple's jdk 6 stuff is getting used. Is there a way to force jdk 7 support?

Thanks! -Ed

Fail to install rJava Centos 6.3

I failed to install rJava in R 2.15.3, with Sun Java 1..6 and gcc 4.4.
I saw a similar problem in stack overflow, someone was having the exact same problem as me, and he was using ubuntu 12.04 with gcc 4.7. He solved the problem with updating his ubuntu to 12.10 with gcc 4.8
What shall I do ? Do I need to updata my gcc to 4.8?

Thank you so very much.

[[email protected] R]# bin/R CMD javareconf
Java interpreter : /usr/bin/java
Java version     : 1.6.0_26
Java home path   : /opt/jdk1.6.0_26/jre
Java compiler    : /usr/bin/javac
Java headers gen.: 
Java archive tool: /usr/bin/jar
NOTE: Your JVM has a bogus java.library.path system property!
      Trying a heuristic via sun.boot.library.path to find jvm library...

 ** WARNING: auto-detection could not find libjvm!
    Your JVM has likely invalid java.library.path property,
    you may want to fix the JVM or set JAVA_LD_LIBRARY_PATH manually.
Java library path: $(JAVA_HOME)/lib/amd64/server:$(JAVA_HOME)/lib/amd64:$(JAVA_HOME)/../lib/amd64:/usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib
JNI linker flags : -L$(JAVA_HOME)/lib/amd64/server -L$(JAVA_HOME)/lib/amd64 -L$(JAVA_HOME)/../lib/amd64 -L/usr/java/packages/lib/amd64 -L/usr/lib64 -L/lib64 -L/lib -L/usr/lib -ljvm
JNI cpp flags    : -I$(JAVA_HOME)/../include -I$(JAVA_HOME)/../include/linux

Updating Java configuration in /opt/R
Done.
[root@s R]# bin/R CMD INSTALL library/ packages/rJava_0.9-3.tar.gz 
Warning: invalid package 'library/'
* installing to library '/opt/R/library'
* installing *source* package 'rJava' ...
** package 'rJava' successfully unpacked and MD5 sums checked
checking for gcc... /usr/bin/make64 MAC=64 -s -f /opt/R/etc/Makeconf -f /opt/R/share/make/config.mk print R_HOME=/opt/R VAR=CC
gcc -std=gnu99
checking for C compiler default output file name... 
configure: error: C compiler cannot create executables
See `config.log' for more details.
configure: WARNING: Cache variable ac_cv_prog_ac_ct_CC contains a newline.
ERROR: configuration failed for package 'rJava'
* removing '/opt/R/library/rJava'

rJava compatible with JDK 7?

Hello, I am trying to develop an interface between R and Presto DB using RJDBC. When I tried to run .jfindClass("com.facebook.presto.jdbc.PrestoDriver") on the JDBC jar, I always got the error class not found. I later realized that Presto JDBC driver requires JDK 7. After removing JDK 6 and installing JDK 7 I discovered that rJava didn't work, and Mac OS prompted me to install JRE SE 6. Does this mean that rJava does not work with JDK 7 and that is why I am unable to find the Presto Driver class?

Installation with Linux and JDK 8u20

I installed Oracle JDK 8u20 on an Amazon Linux instance and successfully ran R CMD javareconf JAVA_HOME=/usr/java/default.

However, when I then try to install rJava I get the following output:

> install.packages("rJava")
Installing package into ‘/home/ec2-user/.Rlibs’
(as ‘lib’ is unspecified)
tentando a URL 'http://cran.us.r-project.org/src/contrib/rJava_0.9-6.tar.gz'
Content type 'application/x-gzip' length 567515 bytes (554 Kb)
URL aberta
==================================================
downloaded 554 Kb

* installing *source* package ‘rJava’ ...
** package ‘rJava’ successfully unpacked and MD5 sums checked
checking for gcc... gcc -std=gnu99
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc -std=gnu99 accepts -g... yes
checking for gcc -std=gnu99 option to accept ISO C89... none needed
checking how to run the C preprocessor... gcc -std=gnu99 -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/wait.h that is POSIX.1 compatible... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for string.h... (cached) yes
checking sys/time.h usability... yes
checking sys/time.h presence... yes
checking for sys/time.h... yes
checking for unistd.h... (cached) yes
checking for an ANSI C-conforming const... yes
checking whether time.h and sys/time.h may both be included... yes
configure: checking whether gcc -std=gnu99 supports static inline...
yes
checking whether setjmp.h is POSIX.1 compatible... yes
checking whether sigsetjmp is declared... yes
checking whether siglongjmp is declared... yes
checking Java support in R... present:
interpreter : '/usr/java/default/jre/bin/java'
archiver    : '/usr/java/default/bin/jar'
compiler    : '/usr/java/default/bin/javac'
header prep.: '/usr/java/default/bin/javah'
cpp flags   : '-I/usr/java/default/include -I/usr/java/default/include/linux'
java libs   : '-L/usr/java/default/jre/lib/amd64/server -ljvm'
checking whether Java run-time works... yes
checking whether -Xrs is supported... yes
checking whether JNI programs can be compiled... yes
checking JNI data types... configure: error: One or more JNI types differ from the corresponding native type. You may need to use non-standard compiler flags or a different compiler in order to fix this.
ERROR: configuration failed for package ‘rJava’
* removing ‘/home/ec2-user/.Rlibs/rJava’
* restoring previous ‘/home/ec2-user/.Rlibs/rJava’

The downloaded source packages are in
    ‘/tmp/RtmpxhW4na/downloaded_packages’
Mensagens de aviso perdidas:
In install.packages("rJava") :
  installation of package ‘rJava’ had non-zero exit status

Any ideas what might be going on here?

Error when install rJava in centos

When I install rJava using install.packages("rJava") in R, there is always an Error:
One or more JNI types differ from the corresponding native type. You may need to use non-standard compiler flags or a different compiler in order to fix this.
I tried lots of ways I can find, but all didn't work, I feel appreciated if you could help me or give me some advice!

My R version is: R version 3.0.3 (2014-03-06) -- "Warm Puppy"
My jdk version is: java version "1.6.0_37" Java(TM) SE Runtime Environment (build 1.6.0_37-b06)

rJava to be installed version is: rJava_0.9-6

R CMD javareconf:

Java interpreter : /opt/jdk1.6.0_37/jre/bin/java
Java version : 1.6.0_37
Java home path : /opt/jdk1.6.0_37/jre
Java compiler : /opt/jdk1.6.0_37/jre/../bin/javac
Java headers gen.: /opt/jdk1.6.0_37/jre/../bin/javah
Java archive tool: /opt/jdk1.6.0_37/jre/../bin/jar

trying to compile and link a JNI progam
detected JNI cpp flags : -I$(JAVA_HOME)/../include -I$(JAVA_HOME)/../include/linux
detected JNI linker flags : -L$(JAVA_HOME)/lib/i386/server -ljvm
gcc -std=gnu99 -I/opt/R/lib/R/include -DNDEBUG -I/opt/jdk1.6.0_37/jre/../include -I/opt/jdk1.6.0_37/jre/../include/linux -I/usr/local/include -fpic -g -O2 -c conftest.c -o conftest.o
gcc -std=gnu99 -shared -L/usr/local/lib -o conftest.so conftest.o -L/opt/jdk1.6.0_37/jre/lib/i386/server -ljvm -L/opt/R/lib/R/lib -lR

JAVA_HOME : /opt/jdk1.6.0_37/jre
Java library path: $(JAVA_HOME)/lib/i386/server
JNI cpp flags : -I$(JAVA_HOME)/../include -I$(JAVA_HOME)/../include/linux
JNI linker flags : -L$(JAVA_HOME)/lib/i386/server -ljvm
Updating Java configuration in /opt/R/lib/R
Done.

Unable to load ZIP library

Hi, i need some help about using rJava to initialize the Java:

I have a problem about using rJava on 64bit Win8, when i using the rJava try to initialize the Java, the R engine throw me an exception:
This exception comes from the jinit function,

.jinit()

"Unable to load ZIP library: C:\Program Files\Java\jre7\bin\zip.dll"

i'm not sure about this problem, because the rJava program works fine on 32bit win7 but not works on 64bit win7 and win8. i dont know why. I have just reinstall my windows operating system today, and try run the r program again, it still running into this error.........

$ call genome_reprogramming_analysis
'pfsnet.footprint_pathway'
'io_device.csv'
'gcmodeller.compiler.csv_tabular'
'pfsnet'
= [0] C:\meme_data\12.21_FOOTPRINT_PATHWAYS\xcb_model\trunk\WT.MonteCarlo\s_ExpressionMatrix.csv
[DEBUG] CSV data "C:\meme_data\12.21_FOOTPRINT_PATHWAYS\xcb_model\trunk\WT.MonteCarlo\s_ExpressionMatrix.csv" load done! 867ms.
Try to start the Java VMs...
Error occurred during initialization of VM
Unable to load ZIP library: C:\Program Files\Java\jre7\bin\zip.dll

image

JRI: chars in REPL callback functions needs reencoding

REPL callback functions in Rcallbacks.c treat chars as UTF8 when bringing chars to (or from) Java. Original chars may not UTF8 depending on user's environment. It often becomes problem in Windows non english region.

Error on UTF-16 surrogate pairs

Java uses UTF-16 internally and encodes Unicode characters above U+FFFF with surrogate pairs. When strings containing such characters are converted to UTF-8 by rJava they are encoded as a pair of 3 byte sequences rather than as the correct 4 byte sequence. This is not valid UTF-8 and will result in "invalid multibyte string" errors.

Emoticons such as astonished face 😲 and pictographs such as bug 🐛 will cause this error. Here is some example code to reproduce the issue.

Can't load rJava in Rstudio 0.98.1091, OS X 10.10.2, Java 1.7.0_60

When I try to load the rJava library, I got the following error:

Error : .onLoad failed in loadNamespace() for 'rJava', details:
  call: dyn.load(file, DLLpath = DLLpath, ...)
  error: unable to load shared object '/Users/xiaoning/Library/R/3.1/library/rJava/libs/rJava.so':
  dlopen(/Users/xiaoning/Library/R/3.1/library/rJava/libs/rJava.so, 6): Library not loaded: @rpath/libjvm.dylib
  Referenced from: /Users/xiaoning/Library/R/3.1/library/rJava/libs/rJava.so
  Reason: image not found
Error: package or namespace load failed for ‘rJava’

Can anyone help me? Thank you!

Create plots in R using JRI

Please see this duplicate on Stackoverflow: http://stackoverflow.com/questions/24891319/how-to-create-plots-in-r-using-jri.

I want to create a plot in R from a Java program and store it on the harddrive. This is not about displaying an R plot in a java window. I'm using JRE as part of the rJava package. Performing calculations in R from java works just fine.

Executing this in R produces a nice plot:
pdf(file="qqplot.pdf")
x <- rnorm(100)
qqnorm(x); qqline(x)
dev.off()

Nevertheless, executing the same from Java produces the same file, but it is empty.

Any ideas on this are highly appreciated!

Compiling problem with Arch Linux: JNI types differ from the corresponding native type

I am running Arch Linux:

*** JAVA_HOME is not a valid path, ignoring
Java interpreter : /opt/java//bin/java
Java version     : 1.7.0_45
Java home path   : /opt/java/jre
Java compiler    : /opt/java/bin/javac
Java headers gen.: /opt/java/bin/javah
Java archive tool: /opt/java/bin/jar

I tried install.packages('rjava') in R:

configure: error: One or more JNI types differ from the corresponding native type. You may need to use non-standard compiler flags or a different compiler in order to fix this.
ERROR: configuration failed for package ‘rJava’
* removing ‘/home/hellolj/R/Rlibrary/3.0/rJava’

I tried OpenJDK as well, still failed to compile.

Cannot find constructor with signature containing arrays and generics

I tried all kind of combinations to instantiate a class, but cannot find out the correct way. The class uses generics but this may not be a problem seen this is a compile-time aspect. The java class to instantiate is http://jacopapi.osolpro.com/org/jacop/search/InputOrderSelect.html

I try to instantiate it with rJava via the call

.jnew("org.jacop.search.InputOrderSelect",
store,
.jarray(var, contents.class="org.jacop.core.Var"),
.jcast(indomain,"org.jacop.search.InDomain"))

The intended constructor has the following signature

// Method descriptor #55 (Lorg/jacop/core/Store;[Lorg/jacop/core/Var;Lorg/jacop/search/Indomain;)V
// Signature: (Lorg/jacop/core/Store;[TT;Lorg/jacop/search/Indomain<TT;>;)V
// Stack: 5, Locals: 7
public InputOrderSelect(org.jacop.core.Store store, org.jacop.core.Var[] variables, org.jacop.search.Indomain indomain);

And here follows some details of the arguments I provide

str(store)
Formal class 'jobjRef' [package "rJava"] with 2 slots
..@ jobj :
..@ jclass: chr "org/jacop/core/Store"
str(var)
List of 4
$ V0:Formal class 'jobjRef' [package "rJava"] with 2 slots
.. ..@ jobj :
.. ..@ jclass: chr "org/jacop/core/IntVar"
$ V1:Formal class 'jobjRef' [package "rJava"] with 2 slots
.. ..@ jobj :
.. ..@ jclass: chr "org/jacop/core/IntVar"
$ V2:Formal class 'jobjRef' [package "rJava"] with 2 slots
.. ..@ jobj :
.. ..@ jclass: chr "org/jacop/core/IntVar"
$ V3:Formal class 'jobjRef' [package "rJava"] with 2 slots
.. ..@ jobj :
.. ..@ jclass: chr "org/jacop/core/IntVar"
str(indomain)
Formal class 'jobjRef' [package "rJava"] with 2 slots
..@ jobj :
..@ jclass: chr "org/jacop/search/IndomainMin"
.jnew("org.jacop.search.InputOrderSelect",store, .jarray(var, contents.class="org.jacop.core.Var"), .jcast(indomain,"org.jacop.search.InDomain"))
Error in .jnew("org.jacop.search.InputOrderSelect", store, .jarray(var, :
java.lang.NoSuchMethodError:

Returning the coefficient parameters from JRI

Hi,

I am trying to run R summary command through JRI to get the result for mulitvariate Linear Regression

eg. result <- lm(Performance Score ~ Department+Grade,data = StudentData)
summary(result)

on running the above cmd using in R Console will fetch me below result:

Call:
lm(formula = Performace.Score ~ Department + Grade, data = tree)

Residuals:
Min 1Q Median 3Q Max
-1.0146 -0.8472 0.1206 0.1528 1.3193

Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 1.9085381 0.2063188 9.250 <2e-16 ***
DepartmentCentral Projects -0.0618622 0.2086085 -0.297 0.767
DepartmentConsulting Services -0.0529854 0.2104055 -0.252 0.801
DepartmentDistribution -0.2280968 0.2268197 -1.006 0.315
DepartmentExecutive 0.0896884 0.4008410 0.224 0.823
DepartmentFinance -0.1366400 0.2503824 -0.546 0.585
DepartmentHR -0.2093362 0.2544092 -0.823 0.411
DepartmentIT -0.0301757 0.2236310 -0.135 0.893
DepartmentLocal Projects 0.1047488 0.2099865 0.499 0.618
DepartmentOperations 0.1009253 0.2078236 0.486 0.627
DepartmentR&D -0.0436125 0.2115470 -0.206 0.837
DepartmentSales -0.1824861 0.2310936 -0.790 0.430
Grade 0.0002534 0.0139614 0.018 0.986

Signif. codes: 0 ‘**’ 0.001 ‘__’ 0.01 ‘’ 0.05 ‘.’ 0.1 ‘ ’ 1

Residual standard error: 0.6768 on 1492 degrees of freedom
Multiple R-squared: 0.0195, Adjusted R-squared: 0.01161
F-statistic: 2.472 on 12 and 1492 DF, p-value: 0.00335

Now, When i try to run the same command through JRI and trying to get only coefficients for same data ,will fetch below result :

[REAL* (1.9085381360123104, -0.061862224682688656, -0.0529853865573166, -0.22809675152091768, 0.0896883836938513, -0.13664002290293625, -0.20933620214453777, -0.03017568582453441, 0.10474877352108226, 0.10092534733241249, -0.04361245714602103, -0.1824861159548225, 2.5335432769115444E-4, 0.20631884004542614, 0.20860854811530719, 0.21040549853856627, 0.2268197334540003, 0.4008409534398062, 0.25038238782600725, 0.2544092401777455, 0.22363101707542418, 0.20998649433526015, 0.20782362789029826, 0.21154702570507078, 0.23109359545008445, 0.013961381053987209, 9.250430719715656, -0.29654693080215805, -0.2518251040269494, -1.0056301012591409, 0.22375054974845454, -0.5457253766502479, -0.8228325433395539, -0.13493515443055484, 0.49883576490325376, 0.48562980233261505, -0.20615963283182023, -0.7896632340650002, 0.018146795557793288, 7.495625279329623E-20, 0.7668537059840453, 0.8012109343341197, 0.31475660028966584, 0.8229820424275262, 0.5853363050818626, 0.4107347156441347, 0.8926813449490922, 0.6179686247435434, 0.6273009677306218, 0.8366943459235678, 0.42984994326833603, 0.9855241729402933)]

From the above result what i get from JRI,will fetch me only coefficient values not the parameters like what we get in R Console(Departments list and Grade in this Case).

So,my question is how to get coefficient values along with parameters.

Thanks

unable to load 'stats'

When I run my code in java I get the error below. The 'stats.dll' does exist in the mentioned directory. When I run RGui it does not give such an error during start up; stats is loaded and works. I even removed 'stats.dll' from the mentioned directory to make sure it is really the dll RGui is using. And, yes, it is the one used by RGui as stats cannot be loaded during RGui start up once that dll removed.

Windows 7
rJava 0.9-7
R 3.1.3 for Windows (64 bit)
Eclipse luna (64 bit)


Error in inDL(x, as.logical(local), as.logical(now), ...) :
unable to load shared object 'C:/Program Files/R/R-3.1.3/library/stats/libs/x64/stats.dll':
LoadLibrary failure: The specified module could not be found.

During startup - Warning message:

package 'stats' in options("defaultPackages") was not found


//My java code (rtest.java from rJava is also included in the package):
package RInterface;
import org.rosuda.JRI.Rengine;
public class myTests {
public static void main(String[] args) {
Rengine re = new Rengine(args, false, new TextConsole());
}
}


R.h: No such file or directory

Hi @s-u ,

I'm working on the your JRI project trying to automate the build using Maven with native-maven-plugin. The process is quite slow because I haven't worked with the native interface before.

I am now encountering the following problem when compiling the C sources:

jri.h:5:15: fatal error: R.h: No such file or directory
#include <R.h>
^

I cannot find the R.h header file anywhere. Could you please advise?

Thanks,
Alex

java.awt.HeadlessException

When I run the followiing commands using rJava, I get java.awt.HeadlessException.

f <- .jnew("java/awt/Frame","Hello")
.jcall(f,,"setVisible",TRUE)

This works fine if I call it from JGR. How can I handle the exception? I am using OS X 10.9.4 and using RStudio.

Is it possible to call .jinit() and set java.awt.headless to false?

rJava fails to deal with JVMTI

I use rJava and call Java code that uses JVMTI code like this

   VM vm = VM.getVM();
    Universe universe = vm.getUniverse();
     CollectedHeap heap = universe.heap();

rJava does not call this code directly but calls a method that in turn internally uses JVMTI.

This code attaches to another JVM and to get its internals. This is legal Java and it works when tested separately. But when I use rJava to call this code, the call is successful but it throws an error. I believe there is Java native Interface involved in the JVM and it seems to affect R. rJava is 0.9

version
_
platform x86_64-apple-darwin10.8.0
arch x86_64
os darwin10.8.0
system x86_64, darwin10.8.0
status
major 3
minor 1.0
year 2014
month 04
day 10
svn rev 65387
language R
version.string R version 3.1.0 (2014-04-10)
nickname Spring Dance

Error: C stack usage 140730070087404 is too close to the limit
Error: C stack usage 140730070156700 is too close to the limit
Warning: stack imbalance in '.Call', 59 then -1
Warning: stack imbalance in '{', 56 then -4

*** caught bus error ***
address 0x100583fd8, cause 'non-existent physical address'

*** caught bus error ***
address 0x100583fd8, cause 'non-existent physical address'

Traceback:
1: run(timeoutMs)
2: service(timeout)

Possible actions:
1: abort (with core dump, if enabled)
2: normal R exit
3: exit R without saving workspace
4: exit R saving workspace
Selection: run(10)

*** caught segfault ***
address 0x20057ea40, cause 'memory not mapped'

Traceback:
1: run(timeoutMs)
2: service(timeout)

Possible actions:
1: abort (with core dump, if enabled)
2: normal R exit
3: exit R without saving workspace
4: exit R saving workspace

JRI: crashed JVM by using Rengine.eval()

On using the method Rengine.eval(String s) the complete JVM crashed.
The error occured on a Windows 7 machine with Java build 1.7.0_45-b18 (64bit).

The problem was, that i used a Windows path like "C:\users\schmitti123" in the string parameter, but I had to used "C:\users\schmitti123".

I wish a better exception handling at this point.

The complete error report from java:

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  Internal Error (os_windows_x86.cpp:143), pid=5212, tid=8112
#  guarantee(result == EXCEPTION_CONTINUE_EXECUTION) failed: Unexpected result from topLevelExceptionFilter
#
# JRE version: Java(TM) SE Runtime Environment (7.0_45-b18) (build 1.7.0_45-b18)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (24.45-b08 mixed mode windows-amd64 compressed oops)
# Failed to write core dump. Minidumps are not enabled by default on client versions of Windows
#
# If you would like to submit a bug report, please visit:
#   http://bugreport.sun.com/bugreport/crash.jsp
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#

---------------  T H R E A D  ---------------

Current thread (0x000000000271f800):  JavaThread "main" [_thread_in_native, id=8112, stack(0x00000000029b0000,0x0000000002ab0000)]

Stack: [0x00000000029b0000,0x0000000002ab0000]
Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
j  org.rosuda.JRI.Rengine.rniParse(Ljava/lang/String;I)J+0
j  org.rosuda.JRI.Rengine.eval(Ljava/lang/String;Z)Lorg/rosuda/JRI/REXP;+53
j  org.rosuda.JRI.Rengine.eval(Ljava/lang/String;)Lorg/rosuda/JRI/REXP;+3
j  Test.init()V+58
j  Test.main([Ljava/lang/String;)V+9
v  ~StubRoutines::call_stub
j  sun.reflect.NativeMethodAccessorImpl.invoke0(Ljava/lang/reflect/Method;Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+0
j  sun.reflect.NativeMethodAccessorImpl.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+87
j  sun.reflect.DelegatingMethodAccessorImpl.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+6
j  java.lang.reflect.Method.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+57
j  com.intellij.rt.execution.application.AppMain.main([Ljava/lang/String;)V+140
v  ~StubRoutines::call_stub

---------------  P R O C E S S  ---------------

Java Threads: ( => current thread )
  0x000000000a75e000 JavaThread "Thread-0" [_thread_blocked, id=9088, stack(0x000000000ae70000,0x000000000af70000)]
  0x000000000a7ae000 JavaThread "Monitor Ctrl-Break" daemon [_thread_in_native, id=1560, stack(0x000000000ace0000,0x000000000ade0000)]
  0x0000000008a71000 JavaThread "Service Thread" daemon [_thread_blocked, id=5424, stack(0x000000000a4b0000,0x000000000a5b0000)]
  0x0000000008a68000 JavaThread "C2 CompilerThread1" daemon [_thread_blocked, id=4936, stack(0x000000000a2a0000,0x000000000a3a0000)]
  0x0000000008a63000 JavaThread "C2 CompilerThread0" daemon [_thread_blocked, id=6436, stack(0x0000000009af0000,0x0000000009bf0000)]
  0x0000000008a61000 JavaThread "Attach Listener" daemon [_thread_blocked, id=5920, stack(0x000000000a180000,0x000000000a280000)]
  0x0000000008a5a000 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=1524, stack(0x0000000009f10000,0x000000000a010000)]
  0x0000000008a07800 JavaThread "Finalizer" daemon [_thread_blocked, id=8400, stack(0x0000000009d10000,0x0000000009e10000)]
  0x00000000089fe800 JavaThread "Reference Handler" daemon [_thread_blocked, id=9020, stack(0x0000000009bf0000,0x0000000009cf0000)]
=>0x000000000271f800 JavaThread "main" [_thread_in_native, id=8112, stack(0x00000000029b0000,0x0000000002ab0000)]

Other Threads:
  0x00000000089f9000 VMThread [stack: 0x00000000099d0000,0x0000000009ad0000] [id=6132]
  0x000000000a5b8800 WatcherThread [stack: 0x000000000aae0000,0x000000000abe0000] [id=8624]

VM state:not at safepoint (normal execution)

VM Mutex/Monitor currently owned by a thread: None

Heap
 PSYoungGen      total 18432K, used 1905K [0x00000000ebb00000, 0x00000000ecf80000, 0x0000000100000000)
  eden space 15872K, 12% used [0x00000000ebb00000,0x00000000ebcdc4b0,0x00000000eca80000)
  from space 2560K, 0% used [0x00000000ecd00000,0x00000000ecd00000,0x00000000ecf80000)
  to   space 2560K, 0% used [0x00000000eca80000,0x00000000eca80000,0x00000000ecd00000)
 ParOldGen       total 41472K, used 0K [0x00000000c3200000, 0x00000000c5a80000, 0x00000000ebb00000)
  object space 41472K, 0% used [0x00000000c3200000,0x00000000c3200000,0x00000000c5a80000)
 PSPermGen       total 21504K, used 3021K [0x00000000be000000, 0x00000000bf500000, 0x00000000c3200000)
  object space 21504K, 14% used [0x00000000be000000,0x00000000be2f3600,0x00000000bf500000)

Card table byte_map: [0x0000000005ab0000,0x0000000005cd0000] byte_map_base: 0x00000000054c0000

Polling page: 0x0000000000230000

Code Cache  [0x0000000002ab0000, 0x0000000002d20000, 0x0000000005ab0000)
 total_blobs=204 nmethods=14 adapters=144 free_code_cache=48743Kb largest_free_block=49898560

Compilation events (10 events):
Event: 0.151 Thread 0x0000000008a63000 nmethod 7 0x0000000002b13710 code [0x0000000002b13860, 0x0000000002b13c78]
Event: 0.151 Thread 0x0000000008a63000   10             java.io.Win32FileSystem::normalize (231 bytes)
Event: 0.152 Thread 0x0000000008a68000 nmethod 9 0x0000000002b13050 code [0x0000000002b131a0, 0x0000000002b13548]
Event: 0.173 Thread 0x0000000008a63000 nmethod 10 0x0000000002b18050 code [0x0000000002b18260, 0x0000000002b191c8]
Event: 0.198 Thread 0x0000000008a68000   12 %           org.rosuda.JRI.Rengine::<init> @ 74 (95 bytes)
Event: 0.199 Thread 0x0000000008a68000 nmethod 12% 0x0000000002b16590 code [0x0000000002b166e0, 0x0000000002b167a8]
Event: 1.011 Thread 0x0000000008a68000   13             java.io.Win32FileSystem::normalize (143 bytes)
Event: 1.016 Thread 0x0000000008a63000   14             sun.nio.cs.UTF_8$Encoder::encode (361 bytes)
Event: 1.017 Thread 0x0000000008a68000 nmethod 13 0x0000000002b116d0 code [0x0000000002b11840, 0x0000000002b11b30]
Event: 1.023 Thread 0x0000000008a63000 nmethod 14 0x0000000002b14050 code [0x0000000002b141a0, 0x0000000002b14688]

GC Heap History (0 events):
No events

Deoptimization events (0 events):
No events

Internal exceptions (10 events):
Event: 0.145 Thread 0x000000000271f800 Threw 0x00000000ebbc9140 at C:\re\jdk7u45\229\hotspot\src\share\vm\prims\jvm.cpp:1244
Event: 0.176 Thread 0x000000000271f800 Threw 0x00000000ebbf3308 at C:\re\jdk7u45\229\hotspot\src\share\vm\prims\jvm.cpp:1244
Event: 0.179 Thread 0x000000000271f800 Threw 0x00000000ebbfbd48 at C:\re\jdk7u45\229\hotspot\src\share\vm\prims\jvm.cpp:1244
Event: 0.182 Thread 0x000000000271f800 Threw 0x00000000ebc01400 at C:\re\jdk7u45\229\hotspot\src\share\vm\prims\jvm.cpp:1244
Event: 0.189 Thread 0x000000000271f800 Threw 0x00000000ebc10990 at C:\re\jdk7u45\229\hotspot\src\share\vm\prims\jvm.cpp:1244
Event: 0.197 Thread 0x000000000271f800 Threw 0x00000000ebc16908 at C:\re\jdk7u45\229\hotspot\src\share\vm\prims\jvm.cpp:1244
Event: 1.015 Thread 0x000000000271f800 Threw 0x00000000ebc2a3f8 at C:\re\jdk7u45\229\hotspot\src\share\vm\prims\jvm.cpp:1244
Event: 1.015 Thread 0x000000000271f800 Threw 0x00000000ebc2a520 at C:\re\jdk7u45\229\hotspot\src\share\vm\prims\jvm.cpp:1244
Event: 1.016 Thread 0x000000000271f800 Threw 0x00000000ebc2e198 at C:\re\jdk7u45\229\hotspot\src\share\vm\prims\jvm.cpp:1244
Event: 1.016 Thread 0x000000000271f800 Threw 0x00000000ebc2e2c0 at C:\re\jdk7u45\229\hotspot\src\share\vm\prims\jvm.cpp:1244

Events (10 events):
Event: 0.235 loading class 0x000000000a85b800
Event: 0.235 loading class 0x000000000a85b800 done
Event: 0.236 loading class 0x000000000a78b590
Event: 0.236 loading class 0x000000000a78b590 done
Event: 1.011 loading class 0x00000000027df980
Event: 1.011 loading class 0x00000000027df980 done
Event: 1.011 loading class 0x000000000a85c470
Event: 1.011 loading class 0x000000000a85c470 done
Event: 1.016 loading class 0x00000000027e05c0
Event: 1.016 loading class 0x00000000027e05c0 done


Dynamic libraries:
0x000000013f6b0000 - 0x000000013f6e3000     C:\Program Files\Java\jdk1.7.0_45\bin\java.exe
0x0000000076cb0000 - 0x0000000076e59000     C:\Windows\SYSTEM32\ntdll.dll
0x0000000076930000 - 0x0000000076a4f000     C:\Windows\system32\kernel32.dll
0x000007fefd430000 - 0x000007fefd49b000     C:\Windows\system32\KERNELBASE.dll
0x000007fefd940000 - 0x000007fefda1b000     C:\Windows\system32\ADVAPI32.dll
0x000007fefecd0000 - 0x000007fefed6f000     C:\Windows\system32\msvcrt.dll
0x000007fefeaa0000 - 0x000007fefeabf000     C:\Windows\SYSTEM32\sechost.dll
0x000007fefd4e0000 - 0x000007fefd60d000     C:\Windows\system32\RPCRT4.dll
0x0000000076a50000 - 0x0000000076b4a000     C:\Windows\system32\USER32.dll
0x000007fefda20000 - 0x000007fefda87000     C:\Windows\system32\GDI32.dll
0x000007fefefb0000 - 0x000007fefefbe000     C:\Windows\system32\LPK.dll
0x000007fefe9d0000 - 0x000007fefea99000     C:\Windows\system32\USP10.dll
0x000007fefbf80000 - 0x000007fefc174000     C:\Windows\WinSxS\amd64_microsoft.windows.common-controls_6595b64144ccf1df_6.0.7601.17514_none_fa396087175ac9ac\COMCTL32.dll
0x000007fefd6b0000 - 0x000007fefd721000     C:\Windows\system32\SHLWAPI.dll
0x000007fefdb30000 - 0x000007fefdb5e000     C:\Windows\system32\IMM32.DLL
0x000007fefeac0000 - 0x000007fefebc9000     C:\Windows\system32\MSCTF.dll
0x000007fefd0d0000 - 0x000007fefd110000     C:\Windows\system32\nvinitx.dll
0x000000000f000000 - 0x000000000f006000     C:\Program Files\NVIDIA Corporation\CoProcManager\_etoured.dll
0x000007fef9000000 - 0x000007fef9056000     C:\Program Files\NVIDIA Corporation\CoProcManager\nvd3d9wrapx.dll
0x000007fefedd0000 - 0x000007fefefa7000     C:\Windows\system32\SETUPAPI.dll
0x000007fefd4a0000 - 0x000007fefd4d6000     C:\Windows\system32\CFGMGR32.dll
0x000007fefe8f0000 - 0x000007fefe9c7000     C:\Windows\system32\OLEAUT32.dll
0x000007fefd730000 - 0x000007fefd933000     C:\Windows\system32\ole32.dll
0x000007fefd1c0000 - 0x000007fefd1da000     C:\Windows\system32\DEVOBJ.dll
0x000007fef8fc0000 - 0x000007fef8ffd000     C:\Program Files\NVIDIA Corporation\CoProcManager\nvdxgiwrapx.dll
0x000000006b1e0000 - 0x000000006b2b2000     C:\Program Files\Java\jdk1.7.0_45\jre\bin\msvcr100.dll
0x000000006a7d0000 - 0x000000006af99000     C:\Program Files\Java\jdk1.7.0_45\jre\bin\server\jvm.dll
0x000007fef6040000 - 0x000007fef6049000     C:\Windows\system32\WSOCK32.dll
0x000007fefec70000 - 0x000007fefecbd000     C:\Windows\system32\WS2_32.dll
0x000007fefecc0000 - 0x000007fefecc8000     C:\Windows\system32\NSI.dll
0x000007fef9b70000 - 0x000007fef9bab000     C:\Windows\system32\WINMM.dll
0x0000000076e70000 - 0x0000000076e77000     C:\Windows\system32\PSAPI.DLL
0x0000000072030000 - 0x000000007203f000     C:\Program Files\Java\jdk1.7.0_45\jre\bin\verify.dll
0x000000006c220000 - 0x000000006c248000     C:\Program Files\Java\jdk1.7.0_45\jre\bin\java.dll
0x000000006c200000 - 0x000000006c215000     C:\Program Files\Java\jdk1.7.0_45\jre\bin\zip.dll
0x000007fefb4c0000 - 0x000007fefb4d0000     C:\Program Files (x86)\JetBrains\IntelliJ IDEA 13.0\bin\breakgen64.dll
0x0000000062d80000 - 0x0000000062da6000     C:\tools\R\R-3.0.2\library\rJava\jri\jri.dll
0x000000006c700000 - 0x000000006cabe000     c:\tools\R\R-3.0.2\bin\x64\R.dll
0x0000000064e80000 - 0x0000000064eda000     c:\tools\R\R-3.0.2\bin\x64\Rblas.dll
0x00000000641c0000 - 0x00000000641e5000     c:\tools\R\R-3.0.2\bin\x64\Riconv.dll
0x0000000063540000 - 0x00000000635b0000     c:\tools\R\R-3.0.2\bin\x64\Rgraphapp.dll
0x000007fefda90000 - 0x000007fefdb27000     C:\Windows\system32\comdlg32.dll
0x000007fefdb60000 - 0x000007fefe8e8000     C:\Windows\system32\SHELL32.dll
0x000007fef9600000 - 0x000007fef9607000     C:\Windows\system32\MSIMG32.dll
0x000000006f8c0000 - 0x000000006f8f2000     c:\tools\R\R-3.0.2\bin\x64\Rzlib.dll
0x000007fefc600000 - 0x000007fefc60c000     C:\Windows\system32\VERSION.dll
0x000000006a770000 - 0x000000006a789000     C:\Program Files\Java\jdk1.7.0_45\jre\bin\net.dll
0x000007fefb2f0000 - 0x000007fefb346000     C:\Windows\system32\uxtheme.dll
0x000007fefc930000 - 0x000007fefc985000     C:\Windows\system32\mswsock.dll
0x000007fefca90000 - 0x000007fefca97000     C:\Windows\System32\wship6.dll
0x000000006e5c0000 - 0x000000006e5e6000     c:\tools\R\R-3.0.2\library\utils\libs\x64\utils.dll
0x0000000064a40000 - 0x0000000064a53000     c:\tools\R\R-3.0.2\library\methods\libs\x64\methods.dll
0x000000006fc80000 - 0x000000006fcd0000     c:\tools\R\R-3.0.2\library\grDevices\libs\x64\grDevices.dll
0x0000000063740000 - 0x0000000063784000     c:\tools\R\R-3.0.2\library\graphics\libs\x64\graphics.dll
0x0000000071100000 - 0x000000007119c000     c:\tools\R\R-3.0.2\library\stats\libs\x64\stats.dll
0x000000000d4a0000 - 0x000000000d729000     c:\tools\R\R-3.0.2\bin\x64\Rlapack.dll

VM Arguments:
jvm_args: -Djava.library.path=;c:\tools\R\R-3.0.2\library\rJava\jri;c:\tools\R\R-3.0.2\bin\x64 -Didea.launcher.port=7538 -Didea.launcher.bin.path=C:\Program Files (x86)\JetBrains\IntelliJ IDEA 13.0\bin -Dfile.encoding=UTF-8
java_command: com.intellij.rt.execution.application.AppMain Test
Launcher Type: SUN_STANDARD

Environment Variables:
JAVA_HOME=c:\Program Files\Java\jdk1.7.0_45\
PATH=c:\tools\R\R-3.0.2\bin\x64\;c:\tools\R\R-3.0.1\library\rjava\jri\
USERNAME=xxx
OS=Windows_NT
PROCESSOR_IDENTIFIER=Intel64 Family 6 Model 37 Stepping 5, GenuineIntel



---------------  S Y S T E M  ---------------

OS: Windows 7 , 64 bit Build 7601 Service Pack 1

CPU:total 4 (2 cores per cpu, 2 threads per core) family 6 model 37 stepping 5, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3, sse4.1, sse4.2, popcnt, aes, ht, tsc, tscinvbit

Memory: 4k page, physical 3985068k(381256k free), swap 7968272k(3322308k free)

vm_info: Java HotSpot(TM) 64-Bit Server VM (24.45-b08) for windows-amd64 JRE (1.7.0_45-b18), built on Oct  8 2013 05:47:22 by "java_re" with unknown MS VC++:1600

time: Thu Mar 06 09:08:33 2014
elapsed time: 1 seconds


Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.