我最近安装了rSymPy来在R中执行一些符号计算。这一步还安装了一些依赖项(“rJava”,“rjson”和“rJython”)。安装完成后,我加载了库并运行了一个非常简单的命令,这给了我一个错误:
> library("rSymPy")
Loading required package: rJython
Loading required package: rJava
Loading required package: rjson
> x <- Var("x")
Error in .jcheck() : No running JVM detected. Maybe .jinit() would help.
这是我的sessionInfo(),以防你需要它:
> sessionInfo()
R version 3.2.2 (2015-08-14)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: CentOS release 6.7 (Final)
locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C
[3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8
[5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8
[7] LC_PAPER=en_US.UTF-8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] rSymPy_0.2-1.1 rJython_0.0-4 rjson_0.2.15 rJava_0.9-8
loaded via a namespace (and not attached):
[1] tools_3.2.2 tcltk_3.2.2
我曾尝试安装所需软件包的不同版本,但我总是遇到此错误。我真的很感激任何帮助。
谢谢, Aashish
答案 0 :(得分:0)
感谢Gabor Grothendieck(rSymPy的开发人员)指出有时需要手动初始化JVM。人们可以简单地使用&#34; sympyStart()&#34;在代码的开头,它修复了错误。