Closed sjayanthi12 closed 9 years ago
The r2pmml
package depends on the JPMML-Converter library, which requires Java 7 or newer to run.
You are getting this error, because your Java version is outdated. It must be Java 6 or older, because it does not recognize class files that are compiled for Java 7 (class file version 51.0). Please verify the version of your Java installation by executing the following command:
$ java -version
If you are indeed running Java 6, then it's time to upgrade, because its End-Of-Life (EOL) was in June 2013.
Anyway, this issue points out a need to improve package self-diagnostics. Will have to see if the rJava
package that mediates R-to-Java communication provides a way to query Java version information and/or handle UnsupportedClassVersionError
s more graciously.
I thought about it. So, updated the java version to 1.8. Still fact this issue. May be will do uninstall and install of library.
Thanks.
The r2pmml
package uses whatever Java version is available via system path. If it still sees Java 1.6, then you need to "flush" your system path.
Did you restart your R development environment (RStudio perhaps?). If that doesn't help, try logging off/logging on again, or even restarting your computer.
Thanks. The issue is java version. I have flush the old versions and I am able to generate pmml.
After installing r2pmml by following the instruction on README.MD, I was able to run my R code with following output:
Call: randomForest(formula = Species ~ ., data = iris, n.tree = 7) Type of random forest: classification Number of trees: 500 No. of variables tried at each split: 2
Confusion matrix: setosa versicolor virginica class.error setosa 50 0 0 0.00 versicolor 0 46 4 0.08 virginica 0 4 46 0.08
However, I see an exception: Error in .jnew("org/jpmml/converter/Main") : java.lang.UnsupportedClassVersionError: org/jpmml/converter/Main : Unsupported major.minor version 51.0
Any thoughts?