0

I want to install "qdap" package to run a text mining project. I tried installing the package in many different ways: 1. intsall.packages("qdap") 2. Downloading the file locally then installing 3. Using devtools

library(devtools)
install_github("trinker/qdapDictionaries")
install_github("trinker/qdapRegex")
install_github("trinker/qdapTools")
install_github("trinker/qdap")

I always had the same problem. It seems to be related to rJava package. I tried to install rJava but I wasn't successful.

I'm more of a data analyst than a developer so I don't have much experience with development (using terminal commands or fixing java on my mac).

I'd really like to use this "qdap" package. Could you please help me figure out in a simple manner?

Here's the error message after I install the package:

The downloaded source packages are in
    ‘/private/var/folders/hk/r0tjy0t57n79lvkh2_fc7snm0000gn/T/RtmpsSJ6Mg/downloaded_packages’
✓  checking for file ‘/private/var/folders/hk/r0tjy0t57n79lvkh2_fc7snm0000gn/T/RtmpsSJ6Mg/remotes42b1730aa4f/trinker-qdap-7f390f7/DESCRIPTION’ (437ms)
─  preparing ‘qdap’: (1.1s)
✓  checking DESCRIPTION meta-information ...
─  checking for LF line-endings in source and make files and shell scripts (1.3s)
─  checking for empty or unneeded directories
   Removed empty directory ‘qdap/tools’
─  looking to see if a ‘data/datalist’ file should be added
─  building ‘qdap_2.4.2.tar.gz’

* installing *source* package ‘qdap’ ...
** R
** data
*** moving datasets to lazyload DB
** inst
** byte-compile and prepare package for lazy loading
Unable to find any JVMs matching version "(null)".
No Java runtime present, try --request to install.
Warning in system("/usr/libexec/java_home", intern = TRUE) :
  running command '/usr/libexec/java_home' had status 1
Error : .onLoad failed in loadNamespace() for 'rJava', details:
  call: dyn.load(file, DLLpath = DLLpath, ...)
  error: unable to load shared object '/Library/Frameworks/R.framework/Versions/3.5/Resources/library/rJava/libs/rJava.so':
  dlopen(/Library/Frameworks/R.framework/Versions/3.5/Resources/library/rJava/libs/rJava.so, 6): Library not loaded: /Library/Java/JavaVirtualMachines/jdk-11.0.1.jdk/Contents/Home/lib/server/libjvm.dylib
  Referenced from: /Library/Frameworks/R.framework/Versions/3.5/Resources/library/rJava/libs/rJava.so
  Reason: image not found
ERROR: lazy loading failed for package ‘qdap’
* removing ‘/Library/Frameworks/R.framework/Versions/3.5/Resources/library/qdap’
Error: Failed to install 'qdap' from GitHub:
  (converted from warning) installation of package ‘/var/folders/hk/r0tjy0t57n79lvkh2_fc7snm0000gn/T//RtmpsSJ6Mg/file42b3e031f25/qdap_2.4.2.tar.gz’ had non-zero exit status

1 Answers1

0

Maybe the key is in the following

Unable to find any JVMs matching version "(null)".
No Java runtime present, try --request to install.

and

Warning in system("/usr/libexec/java_home", intern = TRUE) :
  running command '/usr/libexec/java_home' had status 1

Are you sure you have installed a JVM? And if yes, the correct one? Because it seems to not find it.

You can download JVM from here.

I hope this helps!

MacOS
  • 1,149
  • 1
  • 7
  • 14
  • I managed to install java 8 on my mac but that didn't change anything. Still stuck :( – Mohamad Yassin May 17 '20 at 22:40
  • Did you check the location of the installation? Did you get the same error? – MacOS May 18 '20 at 08:02
  • I'm not very fluent when it comes to java and mac development. But after reading and asking around I came to realize that this is a problem with java + macOS configuration that can only be fixed by accessing dev tools (XTools). Which is a deep rabbit hole. Apparently the "qdap" package isn't suitable for mac users unfortunately. – Mohamad Yassin May 18 '20 at 23:02
  • I see. Maybe this [link](https://www.r-project.org/nosvn/pandoc/qdap.html) helps you out! Also, XTools is insalled these days when you install XCode from the AppStore. Did You install it yet? – MacOS May 19 '20 at 06:24
  • Thanks for sharing the link. I already looked at it and tried all possible angles. It is a java thing and I feel like it would be a deep dive that will sidetrack me from my objective: building a text mining repo. I decided that the best solution is a workaround by using base regex function instead – Mohamad Yassin May 19 '20 at 23:16
  • I asked around and it seems like other people found it difficult to run this package on macOS – Mohamad Yassin May 19 '20 at 23:17