I have created a .java file which used the .jar as the external library file by Eclipse. I only need a little public static function in the .java to run in R, maybe from a "jobject" call in R? does any one how to do it?
The closest solution is from https://stackoverflow.com/a/20291982/2842390:
library(rJava) .jinit(PATH_TO_YOUR_JAR) # this starts the JVM
jobject <- .jnew("yourJavaClass") ## call the constructor
.jcall(jobject ,"I",method="YOUR_METHOD") ## call a method
but I cannot put my .java file in "yourJavaClass" as it results in Error in .jnew("hello3.java") : java.lang.ClassNotFoundException.
Your help is really appreciated!