R Studio For Mac Os Unable To Locate Binary After Install

Active16 days ago
  1. R Studio For Mac Os Unable To Locate Binary After Install Itunes
  2. R Studio For Mac Os Unable To Locate Binary After Install Chrome
  3. R Studio For Mac Os Unable To Locate Binary After Install Google
  4. R Studio For Mac Os Unable To Locate Binary After Installation
  5. R Studio For Mac Os Unable To Locate Binary After Install Kodi
  • So I got brew on my mac and I had tmux installed and running just fine. Then after I refreshed my system every time I try to run tmux i get this error: '-bash: tmux: command not found' So since I'm. Unable to run tmux on OS X. Ask Question. Up vote 0 down vote favorite. First run a 'locate tmux' from the command line to see if the binary.
  • Receiving the error: unable to locate r binary by scanning standard locations when trying to open Rstudio on my Mac. I have mac osx. I just downloaded Rstudio - Mac-OS X 10.6+ from rstudio.com In.

Same issue here on El Capitan. Built fine, libsiftgpu.so is in the bin directory, interface appears, able to load an image set, but fails to find libsiftgpu.so when I try to start a match.

I recently 'upgraded' from OSX Mountain Lion to Yosemite and from R 3.1.3 to 3.2. Immediately after the upgrade, when I opened R or RStudio I got a pop-up message saying that I needed to install Java 6. In addition, loading rJava or any package that depends on rJava (e.g., xlsx) caused RStudio to crash (R also crashed when I tried this by opening R.app directly).

After trying a few fixes found on Stack Overflow and elsewhere (more details below), I am at a point where loading rJava or any package that depends on rJava no longer causes R to crash, but results in the following error:

However, if I invoke R from the command line and then load rJava or any package that depends on rJava, it seems to work (or at least I don't get any error messages).

I've tried a number of different attempted fixes, some of them a few times, and can't quite remember exactly what I did in what order (didn't realize this would be such a morass and wasn't really keeping track), but here's the gist of it:

  • Added the following to my .bash_profile (per this SO answer):

    export JAVA_HOME='/usr/libexec/java_home -v 1.8'
    export LD_LIBRARY_PATH=$JAVA_HOME/jre/lib/server

  • Reconfigured java from the command line as follows:

    sudo R CMD javareconf -n

  • Checked options('java.home') and discovered this was set to NULL. I tried setting it to the following (per this SO question):

    options('java.home'='/Library/Java/JavaVirtualMachines/jdk1.8.0_45.jdk/Contents/Home/jre')

  • Installed the latest Java Development Kit and reinstalled rJava from source (can't remember where I found that one).

At some point while trying all of these, I was able to load rJava without crashing R, but instead got the error message posted above. In addition, when I quit RStudio, it would seem to close normally, but then an 'RStudio quit unexpectedly' message would pop up, indicating that the program had crashed while trying to close.

I finally decided to install Java for OS X 2014-001 (Java 6), as I seemed to be running out of options. Now, when I opened R or RStudio the 'This software needs Java 6' pop-up message no longer appeared. However, I was still getting the .onLoad failed in loadNamespace() for 'rJava' error message posted above.

In reviewing some of the posts I'd already looked at, I noticed another SO answer that I'd missed before, which recommended opening RStudio with the following command line code that gives RStudio the correct path to java:

LD_LIBRARY_PATH=$(/usr/libexec/java_home)/jre/lib/server: open -a RStudio

That opened an RStudio window and I was also able to load rJava and packages that depend on it without getting an error.

Lastly, I tried running R from the command line (which I hadn't done before). It turns out that on the command line, loading rJava or any package that depends on rJava works and does not throw any errors.

So, I can now get rJava to work if I open RStudio from the command line with the code that gives RStudio the java path (as noted above). However, I'd like to find a way to fix the underlying problem, whatever it may be, so that RStudio can be opened in the usual Mac way, without needing a command line kludge. I'm also concerned that having an old version of Java installed could cause problems down the road.

Does anyone have any ideas about how to diagnose and solve this issue?

Alex Popov
3,5211 gold badge13 silver badges17 bronze badges
eipi10eipi10
63.9k16 gold badges122 silver badges185 bronze badges

16 Answers

R Studio For Mac Os Unable To Locate Binary After Install Itunes

I had the same problem and went through the same steps as you. The final step to allow starting RStudio through Finder/Spotlight was to link libjvm.dylib to /usr/local/lib:

-f flag is added to force overwriting existing file/link

Alex PopovAlex Popov
3,5211 gold badge13 silver badges17 bronze badges

On OSX El Capitan 10.11, the user doesn't have permission to write to /usr/lib. So instead, use the following command:

lalaslalasR studio for mac os unable to locate binary after installation
6681 gold badge7 silver badges10 bronze badges

You can load the libjvm.dylib explictly, by run like

yuanyuan

On macOS High Sierra (10.13.1) and Java Version 9 you have to use a slightly different JVM path (notice the missing jre folder in the path compared to the instructions for earlier Java versions):

You also have to notify R about the JVM:

MichaelChirico
21.8k9 gold badges66 silver badges128 bronze badges
EndreEndre

Following command works:

After that, in RStudio, loading rJava works through loading of the 'xlsx' package.

P.S. #1 Environment: Mac OS X El Capitan 10.11.3+ with RStudio 0.99.491+ and R 3.2.3+. (I've now tested this also on macOS Sierra (10.12) and R.3.3.1.)

P.S. #2 I find that openxlsx is much faster and doesn't rely on Java to work, so I'm now using that package. Hope that helps others.

Sander W. van der LaanSander W. van der Laan

This is how I configured it working properly on two Macs running Mac OS X El Capitan (10.11.6):

  1. Uninstall 'rJava' by issuing the following commands in a terminal window:

  2. Download and install the Java software from Oracle: https://www.java.com/en/download/mac_download.jsp

  3. Add the following lines to /Users/<userid>/.bashrc using your favorite editor:

  4. Close and restart any terminal, R, and RStudio windows (to pick up the changes to .bashrc).

  5. Run the following command in a Terminal window:

  6. Run the following command in a Terminal window:

Gregory R. WarnesGregory R. Warnes

You should be able to use the CRAN rJava, without needing to recompile rJava or do any additional steps by linking the shared library to the R frameworks library directory.

JimJim

Here is the easy steps for it:

  1. remove the rJava package: remove.packages(rJava)
  2. close R
  3. install latest Java on you mac
  4. open terminal and type this command: sudo R CMD javareconf
  5. Open R and install rJava with this command:

    install.packages('rJava', dependencies=TRUE, type='source')

slfan
7,19220 gold badges55 silver badges71 bronze badges
Hamidreza Ahady DolatsaraHamidreza Ahady Dolatsara

The image not found issue exists with a brand-new install on OSX High Sierra with the latest Java SE 10 JDK.

R Studio For Mac Os Unable To Locate Binary After Install Chrome

I was able to solve the path issue with rJava using the fix found on the rJava Github issues page: https://github.com/s-u/rJava/issues/78

R CMD javareconf JAVA_CPPFLAGS=-I/System/Library/Frameworks/JavaVM.framework/Headers

GalenGalen

Here what worked for me on MAC:

  1. in your ~/.profile or ~/.bashrc add this line:%export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_102.jdk/Contents/Home

    1.1 % source .profile (or % source .bashrc)

  2. % sudo ln -s $(/usr/libexec/java_home)/jre/lib/server/libjvm.dylib /usr/local/lib
  3. remove.packages(rJava)
  4. remove.packages(Rweka)
  5. From the terminal enter this command: %sudo R CMD javareconf
  6. install.packages('rJava', dependencies = TRUE, type = 'source')
  7. install.packages('rJava', dependencies = TRUE, type = 'source')
  8. Load your library('rJava', 'RWeka')

Best of luck.

kamwo
1,4771 gold badge18 silver badges27 bronze badges
NasserNasser

Maybe another simple answer which does not touch your filesystem:

$ install_name_tool -add_rpath /Library/Java/JavaVirtualMachines/jdk1.8.0_131.jdk/Contents/Home/jre/lib/server /Library/Frameworks/R.framework/Versions/3.4/Resources/library/rJava/libs/rJava.so

(Substitute jdk1.8.0_131.jdk with your JDK path.)

Nathan Tuggy
2,2049 gold badges25 silver badges35 bronze badges
mokjpnmokjpn

Check the location of libjvm.dylib file.

Try this, in my case this worked:

baduker
1,2485 gold badges12 silver badges23 bronze badges
Sagar Neel DeSagar Neel De

I went through all the troubleshooting I could find, then installed jdk-11.0.1_osx-x64_bin.dmg from: Oracle downloads

Everything worked perfectly after that.

Check the version of the library that was not loaded when you run library('rJava') and match it to the java version you need installed.

user2428818user2428818

Here you can download the legacy Java version 6 for El Capitan: https://support.apple.com/kb/DL1572?viewlocale=en_US&locale=en_USAfter doing so, the rJava package works for me.

ignazwignazw

This line below has solved the same problem I was having with rJava package as some others in this discussion did. I'm sure there are more than one solution to this problem and I sincerely thank them all for their contributions because sometimes one line like the one below saves a lot of time from going to trash!

Amit Joshi
8,0918 gold badges34 silver badges73 bronze badges
SüleymanSüleyman

Run the following on the command line: sudo R CMD javareconf

Several solutions above have mentioned this, but they also suggest that one remove and subsequently re-install the rJava package. I found those additional steps to be unnecessary.

Megatron

R Studio For Mac Os Unable To Locate Binary After Install Google

Megatron

R Studio For Mac Os Unable To Locate Binary After Installation

6,6856 gold badges53 silver badges69 bronze badges

R Studio For Mac Os Unable To Locate Binary After Install Kodi

Not the answer you're looking for? Browse other questions tagged javarrstudiorjavamacos-high-sierra or ask your own question.