Unloading rJava and/or restarting JVM
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