rJava – method with signature not found

My problem is similar to this one : Even with adding the semicolon didn’t work for me this is my method when i call .jmethod to display it for me : [10] “public java.util.Set utils.Rinterface.getPhones()” when I call the method, Like this rJava::.jcall(rinterface,”Ljava.util.Set;”,”getPhones”) I got this error : rJava::.jcall(rinterface, “Ljava.util.Set;”, “getPhones”) : method getPhones with … Continue reading “rJava – method with signature not found”

Recently updated R / RStudio, rJava could not be loaded.

I recently updated R to 3.4 and RStudio to its RStudio v1.0.143 Preview so that it’s compatible with the image updates & plots for R, but now I’m having an issue with rJava when trying to load it or packages that require it. It’s as follows: Loading required package: rJava Error: package or namespace load … Continue reading “Recently updated R / RStudio, rJava could not be loaded.”

Cran-R can't find jvm.dll when issuing command library(rJava)

My Cran-R x64 3.3.4 was working fine. However recently, I installed a the latest version of Java because another program required it (Interactive Brokers TWS). Now when I run R and want to load rJava or xlsx I get an error message that jvm.dll can’t be found. TWS runs fine, but apparently R is unhappy. … Continue reading “Cran-R can't find jvm.dll when issuing command library(rJava)”

rJava: Creating zero-length Java arrays from R

I am looking for the rJava equivalent of: String[] s; s= new String[0]; I tried: library(rJava) .jinit() s=.jarray(list(NULL), “[Ljava/lang/String;”) But when passing it to a method expecting a String[] with jcall(…, s), rJava raises an error. Update To make my question clearer. I could, of course, easily make a new jar (or modifying the existing … Continue reading “rJava: Creating zero-length Java arrays from R”

suppress rjava error output in console

How can I suppress the rJava output to the console in the following example? library(rJava) TC <- J(“edu.cens.spatial.RTileController”) dummy <- capture.output(suppressWarnings(suppressMessages( res <- TC$getInstance(type=”osm-bw”)$getTileValues(4389,2691,13) ))) Despite capture.output, I still get the following in the console: java.lang.NullPointerException at edu.cens.spatial.RTileController.getTileValues(RTileController.java:109) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at RJavaTools.invokeMethod(RJavaTools.java:386) Edit: In pure R Console (without … Continue reading “suppress rjava error output in console”

Installing and using rJava-dependent libraries on AWS EC2

I am using the machine image available here to host an RStudio server off of EC2 on which I will want to run analysis, in part using xlsx and rvest, both of which require Java and R to cooperate which they do not out of the box. I searched for a few solutions and tried … Continue reading “Installing and using rJava-dependent libraries on AWS EC2”

Make rJava or R to use a different (previous) Java version

It seems that the last java version makes rJava not able to load or compile / install. Is there any way I can have java8 and java9 installed and force rJava or R use the java8 version? Edit: It’s been suggested that perhaps this thread is the solution to my problem, but it isn’t. Since … Continue reading “Make rJava or R to use a different (previous) Java version”

NoSuchMethodError: <init> when using rJava to create a new object

Recently I came across a problem when using rJava. First I create a public class DirectedEdge: public class DirectedEdge { public int v; public int w; public double weight; public DirectedEdge(){} public DirectedEdge(int v, int w, double weight) { this.v = v; this.w = w; this.weight = weight; } } Then I run the following … Continue reading “NoSuchMethodError: <init> when using rJava to create a new object”