0

I am trying to install the package RWeka. I installed the java version 8, but i am keep getting this error. Can anybody help?

> install.packages('RWeka')

There is a binary version available but the source version is later:
  binary source needs_compilation
RWeka 0.4-26 0.4-33             FALSE

installing the source package ‘RWeka’

trying URL 'https://cran.rstudio.com/src/contrib/RWeka_0.4-33.tar.gz'
Content type 'application/x-gzip' length 415763 bytes (406 KB)
==================================================
downloaded 406 KB

* installing *source* package ‘RWeka’ ...
** package ‘RWeka’ successfully unpacked and MD5 sums checked
Need at least Java version 1.7/7.0.
ERROR: configuration failed for package ‘RWeka’
* removing ``‘/Library/Frameworks/R.framework/Versions/3.3/Resources/library/RWeka’
Warning in install.packages :


installation of package ‘RWeka’ had non-zero exit status

The downloaded source packages are in
‘/private/var/folders/sh/6qsjq6gn0ysf4h1cv9nctzfr0000gn/T/RtmpCVEaSY/downloaded_packages’``
Doris
  • 1
  • 1

2 Answers2

0

From experience, I believe there is a difference between Java and Java Offline.

Try installing the x86/x64 offline version from http://www.oracle.com/technetwork/java/javase/downloads/jre8-downloads-2133155.html (A handy link to keep hold of)

Jason Dealey
  • 310
  • 2
  • 12
  • Thank but i keep get this error while installing. ================================================== downloaded 406 KB * installing *source* package ‘RWeka’ ... ** package ‘RWeka’ successfully unpacked and MD5 sums checked Need at least Java version 1.7/7.0. ERROR: configuration failed for package ‘RWeka’ * removing ‘/Library/Frameworks/R.framework/Versions/3.3/Resources/library/RWeka’ Warning in install.packages : installation of package ‘RWeka’ had non-zero exit status – Doris May 16 '17 at 08:39
  • What is in your environment variables? Do you have a link to java in there? Mine is linking to C:\ProgramData\Oracle\Java\javapath. If you don't have that then maybe try adding it – Jason Dealey May 16 '17 at 10:17
  • i want to find word associations. Therefore, i need the package Rweka, and therefore i need to have java... i do not know where i need to link to the java path... – Doris May 16 '17 at 13:10
  • Start menu > start searching for 'environment variables' in the search bar and click on it > Under System variables, look for PATH and edit it > You'll need to add the javapath location above into this (semi-colon separates each path) > TO EXPLAIN: Whenever an install looks for a program, it will look through your environment variables for the matching program name. It looks as if RWeka cannot find your java install. Hope this helps. – Jason Dealey May 16 '17 at 13:25
  • i don't really get what you mean. Do you mean on my computer (i have a mac) or do you mean in rstudio? because i can not find environment variables in rstudio – Doris May 18 '17 at 07:16
  • Ah Mac. Not got a clue in that regards. I thought you were working with windows – Jason Dealey May 18 '17 at 09:33
0

If you have the newest Java, just open a terminal and run

sudo R CMD javareconf

Then in a R-session,

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

install.packages("RWeka")

Ref: https://justrocketscience.com/post/install-rweka-mac

Community
  • 1
  • 1