简体   繁体   中英

RWeka wont install (mac)

I seem to be having issues installing RWeka in R, on my mac.

I've read through a number of websites but nothing seems to work. I have Java 8 installed on my mac (I'm running OS X Sierra and I'm running R version 3.3.2).

When I attempt to install the R package I get the error:

Warning message: In install.packages("RWeka") : installation of package 'RWeka' had non-zero exit status

In grey letters, several lines up it also says:

Need at least Java version 1.7/7.0.

I'm running the latest version of Java (1.8) but it doesn't seem to sync up with RWeka for some reason. I've tried shutting down R and re-starting it, but that doesn't seem to help either.

R also throws up a pop up informing me:

To use the "java" command-line tool you need to install a JDK. Click "More Info..." to visit the Java Developer Kit download website.

If I click "Ok" it simply opens a mac website but there is nothing on there regarding a Java Developer Kit. I've used the search function on the website with no success. I've googled Java Developer Kit but can't seem to figure out what it is or how it is supposed to even work.

Any ideas on how to remedy this?

The problem was rJava and RWeka wont install in RStudio ( Version 1.0.136 ). The following worked for me ( macOS Sierra version 10.12.6 ) (found here ):

Step-1: Download and install javaforosx.dmg from here

Step-2: Next, run the command from inside RStudio:

install.packages("rJava", type = 'source')
install.packages("RWeka")

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM