rjava

Unloading rJava and/or restarting JVM

不羁的心 提交于 2019-12-03 11:09:21
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

Can't load rJava on MacOS Mojave and R 3.5.2

浪尽此生 提交于 2019-12-01 11:09:55
I have asked a similar question before , but didn't get any answers that I could actually implement. I've also read the answers here and here , but couldn't implement any of them (partially because no answer actually retraces all of its steps. Problem I'm getting an error when trying to load rJava on R 3.5.2 and MacOS Mojave 10.14.3: > library(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.5/Resources

Cannot Initialize CoreNLP in R

北战南征 提交于 2019-12-01 08:33:09
问题 I am unable to access coreNLP in R on a Mac running High Sierra. I am uncertain what the problem is, but it seems that every time I try again to get coreNLP to work, I am faced with a different error. I have JDK 9.0.4. Please see my code below for what I am attempting to do, and the error that stops me. My previous attempt I was able to get initCoreNLP() to run and load some elements of the packages, but it would fail on others. When I then attempted to run annotateString() , it would throw

rjava .jcall issue

天涯浪子 提交于 2019-12-01 05:51:14
I am currently working on developing an R package to integrate java code within R. However, I am having issues trying to properly call the java class methods. So far I have independently developed and compiled a java program into a class file and then packaged it up as a jar file. A sample of my code is as follows: library(rJava) .jinit() .onLoad <- function(lib, pkg) { pathToSdk <- paste(system.file(package = "mailViz") , "C:\\path\\to\\libs", sep="") jarPaths <- c(paste(pathToSdk, "mail.jar", sep=""), paste(pathToSdk, "mailReader.jar", sep="") ) .jpackage(pkg, morePaths=jarPaths) attach(

RNetlogo and NetLogo 5.3 error

那年仲夏 提交于 2019-12-01 00:46:35
I have been using RNetLogo with NetLogo 5.2.1 without troubles. Now I am using NetLogo 5.3 and I get this error: > library(RNetLogo) > nl.path <- "/Applications/NetLogo 5.3/" > NLStart(nl.path, gui = FALSE) java.lang.NoClassDefFoundError: org/nlogo/workspace/Controllable at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:348) Caused by: java.lang.ClassNotFoundException at RJavaClassLoader.findClass(RJavaClassLoader.java:383) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ... 2 more > sessionInfo()

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

荒凉一梦 提交于 2019-11-30 20:37:34
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 GNU/Linux (info given by typing "uname -a" sorry I couldn't quite understand this info) R : R3.0.1, I

rJava on MacOS Sierra 10.12.15: unsupported option fopenmp

别说谁变了你拦得住时间么 提交于 2019-11-30 19:27:20
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 -version java version "1.8.0_131" Java(TM) SE Runtime Environment (build 1.8.0_131-b11) Java HotSpot(TM)

RMongo installation fails with Segmentation Fault in Ubuntu

妖精的绣舞 提交于 2019-11-30 16:04:34
问题 I've been for last couple of hours trying to install the RMongo package with the following output: > install.packages("RMongo") Installing package into ‘/usr/local/lib/R/site-library’ (as ‘lib’ is unspecified) --- Please select a CRAN mirror for use in this session --- trying URL 'https://repo.bppt.go.id/cran/src/contrib/RMongo_0.0.25.tar.gz' Content type 'application/x-gzip' length 4169519 bytes (4.0 MB) ================================================== downloaded 4.0 MB * installing

Include jar file when creating an R package

此生再无相见时 提交于 2019-11-30 15:06:01
问题 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

Loading rJava on Mac OS High Sierra

我与影子孤独终老i 提交于 2019-11-30 15:04:25
I am trying to install rJava package for running the XLConnect package. Here are my system details; R studio:Version 1.0.153 Mac OS High Sierra Version 10.13.1 (17B1003) R version: 3.4.2 jdk-9.0.1 however, i get the following error: I have already followed the following threads on this topic but they don't work for me: trouble installing and loading rJava on mac El Capitan rJava does not run on macOS Sierra rJava load error in RStudio/R after "upgrading" to OSX Yosemite A push in the right direction will be greatly appreciated !! I used the procedure at the following website: https://github