[R] age old problem with rJava

Jeff Newmiller jdnewmil at dcn.davis.ca.us
Thu Oct 27 14:31:10 CEST 2016

The very act of using sudo for this kind of activity creates files that you can only access by using sudo (bad permissions), thereby perpetuating your difficulties. You should be able to limit yourself to only using sudo for installing OS packages (apt-get) which is designed to yield appropriate file permissions for normal use. 

Resolving such gordian knots in the operating system is off topic here, but I would recommend uninstalling R and your ~/R directory and the java runtime and then using the Ubuntu-specific instructions for setting up R that are posted on CRAN and avoid running R with sudo. Only use sudo with apt-get and use a local user-specific R library (~/R) so you don't have to use sudo to install R packages. If you need a system-wide installation then you need to get help in a more OS-specific forum... perhaps R-sig-debian.
Sent from my phone. Please excuse my brevity.

On October 27, 2016 6:42:59 AM CDT, Jim Maas <jimmaasuk at gmail.com> wrote:
>I've installed oracle java 8, at least think I have and tried many
>but still getting this error.  For some reason if I run R as sudo, then
>library rJava loads just fine, but not as user.  Any suggestions most
>Ubuntu 16.04 linux, R 3.3.1 64-bit
>> library(rJava)
>Error : .onLoad failed in loadNamespace() for 'rJava', details:
>  call: dyn.load(file, DLLpath = DLLpath, ...)
>  error: unable to load shared object
>  libjvm.so: cannot open shared object file: No such file or directory
>Error: package or namespace load failed for ‘rJava’
>Jim Maas
>	[[alternative HTML version deleted]]
>R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
>PLEASE do read the posting guide
>and provide commented, minimal, self-contained, reproducible code.

More information about the R-help mailing list