问题
I recently installed package r2pmml and all its dependencies in R
. However, when I'm trying to convert my gbm model object to pmml it throws this error:
r2pmml::r2pmml(model,"model.pmml")
Error in .jnew("org/jpmml/rexp/Main") :
java.lang.UnsupportedClassVersionError: org/jpmml/rexp/Main : Unsupported major.minor version 51.0
I'm a noob when it comes to java and any help is appreciated!
回答1:
You are using an outdated Java version, which does not support Java 1.7 class files - please upgrade. The requirement for Java 1.7 is also stated in r2pmml's README file.
To debug your rJava configuration, please execute the following R script:
library("rJava")
.jinit()
props = .jcall("java/lang/System", "Ljava/util/Properties;", "getProperties")
out = .jfield("java/lang/System", "Ljava/io/PrintStream;", "out")
.jcall(props, "V", "list", out)
Please observe the value of the java.home
property. It must point to a up-to-date Java installation.
来源:https://stackoverflow.com/questions/33882019/problems-with-r2pmml