xlsx or rJava issue

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

xlsx or rJava issue

Dr Didier G. Leibovici
Hi,

I had some issues with java settings when using xlsx.

I had re-installed rJava as well.

 > library(xlsx)
Error : .onLoad failed in loadNamespace() for 'xlsx', details:
   call: .jinit()
   error: JNI_GetCreatedJavaVMs returned -1

Error: package or namespace load failed for ‘xlsx’
JavaVM: requested Java version ((null)) not available. Using Java at ""
instead.
JavaVM: Failed to load JVM: /bundle/Libraries/libserver.dylib
JavaVM FATAL: Failed to load the jvm library.

that file on my machine is in:
/Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk/Contents/Home/jre/lib/server/

is it a particular JAVA_HOME setting or a PATH issue?

I added this in the PATH, re-installed rJava, re-installed xlsx ... nope!
thanks,

Didier

on R version 3.3.2 (2016-10-31)

--
Dr Didier G. Leibovici
    d-d'ye    ley-bow-v-c
Senior Research Fellow
Geocomputational Modelling & Geospatial Statistics
Nottingham Geospatial Institute
University of Nottingham, UK
+44 (0)115 84 13924
http://www.nottingham.ac.uk/ngi/people/didier.leibovici
Google+ [hidden email]
Skype didierleibovici





This message and any attachment are intended solely for the addressee
and may contain confidential information. If you have received this
message in error, please send it back to me, and immediately delete it.

Please do not use, copy or disclose the information contained in this
message or in any attachment.  Any views or opinions expressed by the
author of this email do not necessarily reflect the views of the
University of Nottingham.

This message has been checked for viruses but the contents of an
attachment may still contain software viruses which could damage your
computer system, you are advised to perform your own checks. Email
communications with the University of Nottingham may be monitored as
permitted by UK legislation.


        [[alternative HTML version deleted]]

_______________________________________________
R-sig-Geo mailing list
[hidden email]
https://stat.ethz.ch/mailman/listinfo/r-sig-geo
Reply | Threaded
Open this post in threaded view
|

Re: xlsx or rJava issue

edzer
Didier, this is somewhat off-topic for this list, but in the past I've
solved all my R/java troubles with running, as root

R CMD javareconf

On 17/03/17 10:46, Dr Didier G. Leibovici wrote:

> Hi,
>
> I had some issues with java settings when using xlsx.
>
> I had re-installed rJava as well.
>
>  > library(xlsx)
> Error : .onLoad failed in loadNamespace() for 'xlsx', details:
>    call: .jinit()
>    error: JNI_GetCreatedJavaVMs returned -1
>
> Error: package or namespace load failed for ‘xlsx’
> JavaVM: requested Java version ((null)) not available. Using Java at ""
> instead.
> JavaVM: Failed to load JVM: /bundle/Libraries/libserver.dylib
> JavaVM FATAL: Failed to load the jvm library.
>
> that file on my machine is in:
> /Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk/Contents/Home/jre/lib/server/
>
> is it a particular JAVA_HOME setting or a PATH issue?
>
> I added this in the PATH, re-installed rJava, re-installed xlsx ... nope!
> thanks,
>
> Didier
>
> on R version 3.3.2 (2016-10-31)
>
--
Edzer Pebesma
Institute for Geoinformatics  (ifgi),  University of Münster
Heisenbergstraße 2, 48149 Münster, Germany; +49 251 83 33081
Journal of Statistical Software:   http://www.jstatsoft.org/
Computers & Geosciences:   http://elsevier.com/locate/cageo/


_______________________________________________
R-sig-Geo mailing list
[hidden email]
https://stat.ethz.ch/mailman/listinfo/r-sig-geo

signature.asc (484 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: xlsx or rJava issue

Dr Didier G. Leibovici
In reply to this post by Dr Didier G. Leibovici
A bit of dig up on google and I found
(http://stackoverflow.com/questions/35179151/cannot-load-r-xlsx-package-on-mac-os-10-11)
which resolves the thing in a terminal but when using Rgui same thing (?)

I tried re-installing in Rgui and now it is library(rJava) which cannot
load (?)

library(xlsx)
Loading required package: rJava
Error : .onLoad failed in loadNamespace() for 'rJava', details:
   call: dyn.load(file, DLLpath = DLLpath, ...)
   error: unable to load shared object
'/Users/lgzdl/Library/R/3.3/library/rJava/libs/rJava.so':
   dlopen(/Users/lgzdl/Library/R/3.3/library/rJava/libs/rJava.so, 6):
Library not loaded: @rpath/libjvm.dylib
   Referenced from: /Users/lgzdl/Library/R/3.3/library/rJava/libs/rJava.so
   Reason: image not found
Error: package ‘rJava’ could not be loaded

but at least I can work with R in a terminal!

cheers to SanjayIV,

Didier



On 17/03/2017 09:46, Dr Didier G. Leibovici wrote:

> Hi,
>
> I had some issues with java settings when using xlsx.
>
> I had re-installed rJava as well.
>
>   > library(xlsx)
> Error : .onLoad failed in loadNamespace() for 'xlsx', details:
>     call: .jinit()
>     error: JNI_GetCreatedJavaVMs returned -1
>
> Error: package or namespace load failed for ‘xlsx’
> JavaVM: requested Java version ((null)) not available. Using Java at ""
> instead.
> JavaVM: Failed to load JVM: /bundle/Libraries/libserver.dylib
> JavaVM FATAL: Failed to load the jvm library.
>
> that file on my machine is in:
> /Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk/Contents/Home/jre/lib/server/
>
> is it a particular JAVA_HOME setting or a PATH issue?
>
> I added this in the PATH, re-installed rJava, re-installed xlsx ... nope!
> thanks,
>
> Didier
>
> on R version 3.3.2 (2016-10-31)
>

--
Dr Didier G. Leibovici
    d-d'ye    ley-bow-v-c
Senior Research Fellow
Geocomputational Modelling & Geospatial Statistics
Nottingham Geospatial Institute
University of Nottingham, UK
+44 (0)115 84 13924
http://www.nottingham.ac.uk/ngi/people/didier.leibovici
Google+ [hidden email]
Skype didierleibovici





This message and any attachment are intended solely for the addressee
and may contain confidential information. If you have received this
message in error, please send it back to me, and immediately delete it.

Please do not use, copy or disclose the information contained in this
message or in any attachment.  Any views or opinions expressed by the
author of this email do not necessarily reflect the views of the
University of Nottingham.

This message has been checked for viruses but the contents of an
attachment may still contain software viruses which could damage your
computer system, you are advised to perform your own checks. Email
communications with the University of Nottingham may be monitored as
permitted by UK legislation.


        [[alternative HTML version deleted]]

_______________________________________________
R-sig-Geo mailing list
[hidden email]
https://stat.ethz.ch/mailman/listinfo/r-sig-geo
Reply | Threaded
Open this post in threaded view
|

Re: xlsx or rJava issue

Dr Didier G. Leibovici
In reply to this post by edzer
Yes, thanks Edzer I found this solution though Rgui didn't seem to get
it (could that be after a reboot?) thanks, Didier


On 17/03/2017 09:56, Edzer Pebesma wrote:

> Didier, this is somewhat off-topic for this list, but in the past I've
> solved all my R/java troubles with running, as root
>
> R CMD javareconf
>
> On 17/03/17 10:46, Dr Didier G. Leibovici wrote:
>> Hi,
>>
>> I had some issues with java settings when using xlsx.
>>
>> I had re-installed rJava as well.
>>
>>   > library(xlsx)
>> Error : .onLoad failed in loadNamespace() for 'xlsx', details:
>>     call: .jinit()
>>     error: JNI_GetCreatedJavaVMs returned -1
>>
>> Error: package or namespace load failed for �xlsx�
>> JavaVM: requested Java version ((null)) not available. Using Java at ""
>> instead.
>> JavaVM: Failed to load JVM: /bundle/Libraries/libserver.dylib
>> JavaVM FATAL: Failed to load the jvm library.
>>
>> that file on my machine is in:
>> /Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk/Contents/Home/jre/lib/server/
>>
>> is it a particular JAVA_HOME setting or a PATH issue?
>>
>> I added this in the PATH, re-installed rJava, re-installed xlsx ... nope!
>> thanks,
>>
>> Didier
>>
>> on R version 3.3.2 (2016-10-31)
>>
>
>
> _______________________________________________
> R-sig-Geo mailing list
> [hidden email]
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
--
Dr Didier G. Leibovici
    d-d'ye    ley-bow-v-c
Senior Research Fellow
Geocomputational Modelling & Geospatial Statistics
Nottingham Geospatial Institute
University of Nottingham, UK
+44 (0)115 84 13924
http://www.nottingham.ac.uk/ngi/people/didier.leibovici
Google+ [hidden email]
Skype didierleibovici





This message and any attachment are intended solely for the addressee
and may contain confidential information. If you have received this
message in error, please send it back to me, and immediately delete it.

Please do not use, copy or disclose the information contained in this
message or in any attachment.  Any views or opinions expressed by the
author of this email do not necessarily reflect the views of the
University of Nottingham.

This message has been checked for viruses but the contents of an
attachment may still contain software viruses which could damage your
computer system, you are advised to perform your own checks. Email
communications with the University of Nottingham may be monitored as
permitted by UK legislation.


        [[alternative HTML version deleted]]


_______________________________________________
R-sig-Geo mailing list
[hidden email]
https://stat.ethz.ch/mailman/listinfo/r-sig-geo
Reply | Threaded
Open this post in threaded view
|

Re: xlsx or rJava issue

R-sig-geo mailing list
In reply to this post by Dr Didier G. Leibovici
Didier, I noticed you are using macOS. Are you by any chance using RStudio as well? If yes, besides Edzer's suggestion, the following command has also helped me in the past:

sudo ln -f -s $(/usr/libexec/java_home)/jre/lib/server/libjvm.dylib /usr/local/lib

Then, try re-installing rJava - *from source* - now. It should work.
 Hope this helps,
 -- Thiago V. dos Santos

PhD student
Land and Atmospheric Science
University of Minnesota



On Friday, March 17, 2017 4:52 AM, Dr Didier G. Leibovici <[hidden email]> wrote:
Hi,

I had some issues with java settings when using xlsx.

I had re-installed rJava as well.

> library(xlsx)
Error : .onLoad failed in loadNamespace() for 'xlsx', details:
   call: .jinit()
   error: JNI_GetCreatedJavaVMs returned -1

Error: package or namespace load failed for ‘xlsx’
JavaVM: requested Java version ((null)) not available. Using Java at ""
instead.
JavaVM: Failed to load JVM: /bundle/Libraries/libserver.dylib
JavaVM FATAL: Failed to load the jvm library.

that file on my machine is in:
/Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk/Contents/Home/jre/lib/server/

is it a particular JAVA_HOME setting or a PATH issue?

I added this in the PATH, re-installed rJava, re-installed xlsx ... nope!
thanks,

Didier

on R version 3.3.2 (2016-10-31)

--
Dr Didier G. Leibovici
    d-d'ye    ley-bow-v-c
Senior Research Fellow
Geocomputational Modelling & Geospatial Statistics
Nottingham Geospatial Institute
University of Nottingham, UK
+44 (0)115 84 13924
http://www.nottingham.ac.uk/ngi/people/didier.leibovici
Google+ [hidden email]
Skype didierleibovici





This message and any attachment are intended solely for the addressee
and may contain confidential information. If you have received this
message in error, please send it back to me, and immediately delete it.

Please do not use, copy or disclose the information contained in this
message or in any attachment.  Any views or opinions expressed by the
author of this email do not necessarily reflect the views of the
University of Nottingham.

This message has been checked for viruses but the contents of an
attachment may still contain software viruses which could damage your
computer system, you are advised to perform your own checks. Email
communications with the University of Nottingham may be monitored as
permitted by UK legislation.


    [[alternative HTML version deleted]]

_______________________________________________
R-sig-Geo mailing list
[hidden email]
https://stat.ethz.ch/mailman/listinfo/r-sig-geo 

_______________________________________________
R-sig-Geo mailing list
[hidden email]
https://stat.ethz.ch/mailman/listinfo/r-sig-geo
Reply | Threaded
Open this post in threaded view
|

Re: xlsx or rJava issue

Dr Didier G. Leibovici
Thank you Thiago that worked!

Rgui:

 > library(rJava)
 > library(xlsx)
Loading required package: xlsxjars
 >


On 17/03/2017 10:17, Thiago V. dos Santos wrote:

> Didier, I noticed you are using macOS. Are you by any chance using RStudio as well? If yes, besides Edzer's suggestion, the following command has also helped me in the past:
>
> sudo ln -f -s $(/usr/libexec/java_home)/jre/lib/server/libjvm.dylib /usr/local/lib
>
> Then, try re-installing rJava - *from source* - now. It should work.
>   Hope this helps,
>   -- Thiago V. dos Santos
>
> PhD student
> Land and Atmospheric Science
> University of Minnesota
>
>
>
> On Friday, March 17, 2017 4:52 AM, Dr Didier G. Leibovici <[hidden email]> wrote:
> Hi,
>
> I had some issues with java settings when using xlsx.
>
> I had re-installed rJava as well.
>
>> library(xlsx)
> Error : .onLoad failed in loadNamespace() for 'xlsx', details:
>     call: .jinit()
>     error: JNI_GetCreatedJavaVMs returned -1
>
> Error: package or namespace load failed for ‘xlsx’
> JavaVM: requested Java version ((null)) not available. Using Java at ""
> instead.
> JavaVM: Failed to load JVM: /bundle/Libraries/libserver.dylib
> JavaVM FATAL: Failed to load the jvm library.
>
> that file on my machine is in:
> /Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk/Contents/Home/jre/lib/server/
>
> is it a particular JAVA_HOME setting or a PATH issue?
>
> I added this in the PATH, re-installed rJava, re-installed xlsx ... nope!
> thanks,
>
> Didier
>
> on R version 3.3.2 (2016-10-31)
>

--
Dr Didier G. Leibovici
    d-d'ye    ley-bow-v-c
Senior Research Fellow
Geocomputational Modelling & Geospatial Statistics
Nottingham Geospatial Institute
University of Nottingham, UK
+44 (0)115 84 13924
http://www.nottingham.ac.uk/ngi/people/didier.leibovici
Google+ [hidden email]
Skype didierleibovici





This message and any attachment are intended solely for the addressee
and may contain confidential information. If you have received this
message in error, please send it back to me, and immediately delete it.

Please do not use, copy or disclose the information contained in this
message or in any attachment.  Any views or opinions expressed by the
author of this email do not necessarily reflect the views of the
University of Nottingham.

This message has been checked for viruses but the contents of an
attachment may still contain software viruses which could damage your
computer system, you are advised to perform your own checks. Email
communications with the University of Nottingham may be monitored as
permitted by UK legislation.


        [[alternative HTML version deleted]]

_______________________________________________
R-sig-Geo mailing list
[hidden email]
https://stat.ethz.ch/mailman/listinfo/r-sig-geo