2

So, I installed RWeka on my MacBook OS X El Capitan Version 10.11.6, however when I run

library(RWeka)

I get the error

Error : .onLoad failed in loadNamespace() for 'RWeka', details:
call: .jnew("weka/core/WekaPackageClassLoaderManager")
error: java.lang.UnsupportedClassVersionError:weka/core/WekaPackageClassLoaderManager : Unsupported major.minor version 51.0
Error: package or namespace load failed for 'RWeka'

My R version is

 R.Version()

$platform
[1] "x86_64-apple-darwin13.4.0"

$arch
[1] "x86_64"

$os
[1] "darwin13.4.0"

$system
[1] "x86_64, darwin13.4.0"

$status
[1] ""

$major
[1] "3"

$minor
[1] "3.2"

$year
[1] "2016"

$month
[1] "10"

$day
[1] "31"

$`svn rev`
[1] "71607"

$language
[1] "R"

$version.string
[1] "R version 3.3.2 (2016-10-31)"

$nickname
[1] "Sincere Pumpkin Patch"

When I run in the Mac Terminal:

java -version
java version "1.8.0_121"
Java(TM) SE Runtime Environment (build 1.8.0_121-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.121-b13, mixed mode)

I also tried

sudo rm /usr/bin/java
sudo ln -s /Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin/java /usr/bin

Which results in

whereis java
/usr/bin/java

Can someone help me to load RWeka properly?

I have installed Weka on my computer. I have installed 'rJava' as well in R Studio. I don't understand the problem.

I tried out a lot of things, even installed 1.6, but my final output in latest version java Terminal was:

export JAVA_HOME=/usr/lib/jvm/java-6-sun/jre
export PATH=$PATH:$JAVA_HOME/bin
sudo ln -f -s $(/usr/libexec/java_home)/jre/lib/server/libjvm.dylib /usr/local/lib

It took me 4 hour to solve the problem. It seems that after a mac system version update the java version preferences option was removed.

cappuccino
  • 325
  • 3
  • 13
  • 1
    usually that is related more with the version compiler rather than the JRE, JVM or other...Please check this [post](http://stackoverflow.com/questions/10382929/how-to-fix-java-lang-unsupportedclassversionerror-unsupported-major-minor-versi) and let us know if it gives your other approach to your problem. – David Leal Feb 19 '17 at 19:40
  • Yes it did thanks. I will write an answer to the question – cappuccino Feb 19 '17 at 21:33

0 Answers0