I have a es.r script which is written in rJava.So My R script internally calls my Java functions . I created a batch file for setting the classPath with all the dependencies . I am able to run the script in terminal using Rscript.But when I try to run the script from RConsole using source() I am getting Class Not Found Exception .

Any Idea ?

EDIT

Included

#!/usr/bin/Rscript
library(rJava)
#.jclassPath()
.jinit()
.jaddClassPath(dir("E:\\Documents and Settings\\Admin\\My Documents\\Downloads\\OG-R\\target\\mavenLib", full.names=TRUE ))

.jclassPath()

got

Error in .jcall(obj, "[[Ljava/lang/String;", "getAllContentFromKeyword", : java.lang.NullPointerException

有帮助吗?

解决方案

The message said that it can't find the class path ,probably because you specified an aboslute path.

maybe you can try this :

library(rJava) 
.jinit() 
.jaddClassPath(yourclassPath) 
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top