Frustration using rJava to call a third party Java jar

后端 未结 1 2086
闹比i
闹比i 2020-12-17 21:23

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-Ja

相关标签:
1条回答
  • 2020-12-17 21:37

    Let me preface my answer by saying that I'm no expert in Java / rJava, so apologies if this isn't 100% correct. I hope it's a step in the right direction though.

    Start by unzipping gsrad_sample.jar to C:/gsrad (or adjust your paths based on where you unzip it). Then add all the contents of C:/gsrad/lib to your class path:

    library(rJava)
    .jinit()
    .jaddClassPath(dir( "C:/gsrad/lib", full.names=TRUE ))
    .jclassPath()
    .jnew( "cra/clima/gsrad/GSRBristowCampbellStrategy" )
    
    0 讨论(0)
提交回复
热议问题