Error in RWeka in R package
<p>I have searched SO and everywhere else and nothing works to fix the unsupported major.minor version 51 error. I uninstalled Java 8 and installed Java 7. No luck.
Thank you for your help.
I am using:
 R 3.3.1
Java 8.91
OSX, el capitan
library(NLP)
library(tm)
library(RWeka)
library(rJava)
library((RWekajars))
library(parallel)
options(mc.cores=1)
Here is the R code causing the error:</p>

<pre><code>trigram &lt;- function(x){NGramTokenizer(x,control=Weka_control(min=3,max=3))}
tdm &lt;- TermDocumentMatrix(corpus2,control=list(tokenize=trigram))

Here is the error I get.
 Error in .jnew(name) : 
  java.lang.UnsupportedClassVersionError: weka/core/tokenizers/NGramTokenizer : Unsupported major.minor version 51.0 
9 stop(structure(list(message = "java.lang.UnsupportedClassVersionError: weka/core/tokenizers/NGramTokenizer : Unsupported major.minor version 51.0", 
    call = .jnew(name), jobj = &lt;S4 object of class structure("jobjRef", package = "rJava")&gt;), .Names = c("message", 
"call", "jobj"), class = c("UnsupportedClassVersionError", "ClassFormatError", 
"LinkageError", "Error", "Throwable", "Object", "Exception",  ... 
8 .jnew(name) 
7 NGramTokenizer(x, control = Weka_control(min = 3, max = 3)) 
6 .tokenize(doc) 
5 FUN(X[[i]], ...) 
4 lapply(X = X, FUN = FUN, ...) 
3 mclapply(unname(content(x)), termFreq, control) 
2 TermDocumentMatrix.VCorpus(corpus2, control = list(tokenize = trigram)) 
1 TermDocumentMatrix(corpus2, control = list(tokenize = trigram)) 
</code></pre>