Mark R
Mark R

Reputation: 1009

RWeka throws java.lang.UnsupportedClassVersionError under OSX 10.10.5

I'm getting the following error message with RWeka 0.4-28 under OS 10.5.5 when I try to create classifiers:

Error in .jnew("weka/core/Attribute", attname[i], .jcast(levels, "java/util/List")) : java.lang.UnsupportedClassVersionError: weka/core/Attribute : Unsupported major.minor version 51.0

I've checked in terminal and my Java is up-to-date

java version "1.8.0_92"
Java(TM) SE Runtime Environment (build 1.8.0_92-b14)

Is this a bug in RWeka or something with my configuration?

Upvotes: 0

Views: 2210

Answers (2)

Ryan Tillis
Ryan Tillis

Reputation: 1

You might have to replace the /usr/bin/java symlink so that it points to /Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin/java instead:

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

Upvotes: 0

ck1
ck1

Reputation: 5443

Are you sure that you're running RWeka using JDK 8? Based on the UnsupportedClassVersionError, it appears you're running the application using JDK 6. major.minor version 51.0 indicates that the classes for RWeka were compiled with JDK 7, which should be handled fine by JDK 8 (but not by JDK 6).

Can you provide the output of the following command in your terminal? Also, can you provide more details about how you're launching the app, e.g. using a shell script, Launchpad icon in the Dock, etc.

$ java -version

Update: have you tried updating R to use JDK 8?

$ sudo R CMD javareconf

Upvotes: 2

Related Questions