rjava

Include jar file when creating an R package

别来无恙 提交于 2019-11-30 13:23:27
I created a skeleton R package: lib jarFileHere.jar R r_code_file.R The r_code_file.R tries to references a class file in jarFileHere.jar : library("rJava") library("rjson") .onLoad <- function(libname, pkgname) { .jpackage(pkgname, lib.loc=libname) } .onLoad("packagename", "../lib/jarFileHere.jar") .jnew("com/test/ClassHere", "") But I get a failure due to java.lang.NoClassDefFoundError. I was able to get it to work using .jinit .jaddClassPath("../lib/jarFileHere.jar") but the rJava docs explicitly says not to use .jinit because it won't work when the code is used as a package. Make your

Error of java path on loading rJava package

喜欢而已 提交于 2019-11-30 08:18:44
I am trying to load 'rJava' package in my Unix machine. Before loading I have set the path using Sys.setenv("JAVA_HOME= myfilepath") in my R script. Despite this I am getting the following error (Below is the part of the error): checking Java support in R... present: interpreter : '/usr/lib/jvm/jre/bin/java' archiver : '/usr/lib/jvm/jre/../bin/jar' compiler : '/usr/lib/jvm/jre/../bin/javac' header prep.: '/usr/lib/jvm/jre/../bin/javah' cpp flags : '-I/usr/lib/jvm/java/include I/usr/lib/jvm/java/include/linux' java libs : '-L/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/lib/amd64/server

trouble installing and loading rJava on mac El Capitan

北城余情 提交于 2019-11-30 07:32:01
问题 Have issue installing rJava, tried most troubleshooting steps here and doesn't work. It's returning error Loading required package: rJava Error: package or namespace load failed for 'rJava': .onLoad failed in loadNamespace() for 'rJava', details: call: dyn.load(file, DLLpath = DLLpath, ...) error: unable to load shared object '/Library/Frameworks/R.framework/Versions/3.4/Resources/library/rJava/libs/ rJava.so': I'm on latest ver of R/Rstudio and Mac El Capitan I also tried this method 1 which

install rJava - “configure: error: One or more JNI types differ from the corresponding native type”

若如初见. 提交于 2019-11-30 05:31:20
问题 I have came across this problem while installing rJava on R3.0.1: "configure: error: One or more JNI types differ from the corresponding native type" The detailed message is attached below. I searched for similar problems but my issue is a little trickier and many proposed solutions either didnt work or I could not try, because I am working on a server which I do not have write access to system libraries. OS : Linux 2.6.18-348.6.1.el5 #1 SMP Tue May 21 15:44:27 EDT 2013 x86_64 x86_64 x86_64

rJava on MacOS Sierra 10.12.15: unsupported option fopenmp

旧街凉风 提交于 2019-11-30 03:41:18
问题 I'm trying to install rJava on MacOS Sierra. Have to tried the tips and guides elsewhere for other other version MacOS such as https://github.com/snowflakedb/dplyr-snowflakedb/wiki/Configuring-R-rJava-RJDBC-on-Mac-OS-X and Install xlsx and rJava on Mac but it does not work out. Much appreciate any help. Thanks. My Mac version: macOS Sierra, version 10.12.15 My R version: 3.4.0 (2017-04-21) My Rstudio version: Version 0.99.903 Java version: bash-3.2$ /usr/libexec/java_home -V bash-3.2$ java

Installation of rJava

偶尔善良 提交于 2019-11-30 03:28:12
I've tried to solve this using the previous questions/answers on SO but without any success. So, here's my problem. I'm using RStudio on and Ubuntu box (14.04) and I tried to upgrade rJava from sources and in the process I managed to lose it. I tried to install it again using, install.packages("rJava") which returned the following error message, configure: error: One or more Java configuration variables are not set. Make sure R is configured with full Java support (including JDK). Run R CMD javareconf as root to add Java support to R. If you don't have root privileges, run R CMD javareconf -e

.onLoad failed in loadNamespace() for 'rJava' when installing a package

放肆的年华 提交于 2019-11-29 16:55:01
问题 I have a package "javaOnLoadFailed" (just a minimal package for testing my issue, hence the weird name) which imports rJava. I get 'rJava' errors when I try to either check() or install() the package, even though require(rJava) itself works fine. install() gives the following errors: > install() Installing javaOnloadFailed "C:/Program Files/R/R-3.2.0/bin/x64/R" --no-site-file --no-environ --no-save \ --no-restore CMD INSTALL \ "C:/Projects/stackoverflow/javaOnloadFailed/javaOnLoadFailed" \ -

R: Cannot install rJava; what is r-api-3.4?

南楼画角 提交于 2019-11-29 10:02:23
I am on an Ubuntu 18.04 machine with R version 3.5.1, installed following this link . I am trying to install the CRAN package rJava , which I do the following way (as seen here ): sudo apt-get install r-cran-rjava However, I get this: The following packages have unmet dependencies: r-cran-rjava : Depends: r-api-3.4 E: Unable to correct problems, you have held broken packages. But when I try: sudo apt-get install r-api-3.4 I get: E: Package 'r-api-3.4' has no installation candidate How to overcome this problem with r-api-3.4 ? Basically, I need to install rJava to be able to install and use

Setting up Java R Interface (JRI) on Windows

心不动则不痛 提交于 2019-11-29 08:03:37
I have followed guides on the web and looked at questions on stackoverflow but I am still not able to set up JRI on Windows. Here are the steps I have taken: 1) Install R 2) Execute install.packages("rJava") in R to install rJava 3) Create a R_HOME system variable with value C:\Program Files\R\R-3.1.2 4) Add the following to my PATH variable: C:\Program Files\R\R-3.1.2\bin\x64;C:\Users\USERNAME\Documents\R\win-library\3.1\rJava\jri\x64 5) Added the JRI.jar (located in C:\Users\USERNAME\Documents\R\win-library\3.1\rJava\jri ) as a dependency in IntelliJ 6) Set the VM options in IntelliJ to

Frustration using rJava to call a third party Java jar

青春壹個敷衍的年華 提交于 2019-11-29 06:24:42
I'm trying to use R to hook the Java code from the GSRad project. The GSRad Java code is available online and comes as a One-Jar project jar (I was not familiar with One-Jar until today). I can run the One-Jar file just dandy using the following command (after unzipping the file from the above link): java -jar gsrad_sample.jar When I pop open the gsrad_sample.jar file I see a jar titled clima_GSRAD-1.0.0.jar in the /lib/ directory which contains the class files I want to hook with R. I've pulled out the jar of my affection and tried the following, to no avail: library(rJava) .jinit()