Reputation: 41
I am doing a Capstone Project from Coursera Data Science using R Studio, using some packages as RWeka, rJava, RWekajars that needs Java.
I am not a specialist in Java, but I install the JRE and JDK at the same version "1.8.0_101".
When the algorithm of Tokenization was running it abort with the following message:
Error in .jnew(name) : java.lang.UnsupportedClassVersionError: weka/core/tokenizers/NGramTokenizer : Unsupported major.minor version 51.0
I read a lot about this in others questions, but everything that I tried it doesn't work.
Let me know if someone has the same problem and if there is a solution?
Thanks. (My hardware is a MAC i5 with 8GB and 1TB HD. My software is a macOS Sierra 10.12).
Upvotes: 4
Views: 1710
Reputation: 113
I'm not sure if this is the root cause of the issue, but I did have to do these steps to get rJava and RWeka installed.
These commands needed to install rJava and remaining libraries properly
sudo ln -s $(/usr/libexec/java_home)/jre/lib/server/libjvm.dylib /usr/local/lib
sudo R CMD javareconf
LD_LIBRARY_PATH=$(/usr/libexec/java_home)/jre/lib/server: open -a RStudio
install.packages("rJava",type='source')
install.packages("RWeka",type='source')
install.packages(c("NLP", "openNLP", "qdap"))
Upvotes: 3