“unable to load shared object” when loading the rJava library












0














I apologize in advance for my bad english, i hope that someone can help me.
I have to load an Excel file .xlsx on R, but:



library(xlsx)



Error: package or namespace load failed for ‘rJava’:
.onLoad failed in loadNamespace() for 'rJava', details:
call: inDL(x, as.logical(local), as.logical(now), ...)
error: unable to load shared object 'C:/Users/danil/Documents/R/win-library/3.4/rJava/libs/x64/rJava.dll':
LoadLibrary failure: Impossibile trovare il modulo specificato.
Error: package ‘rJava’ could not be loaded




So, i tried to install Java, Java SE-Development Kit 10 and Java Runtime Environment 10, 64 bit for both. But, also in this case:



library(rJava)



Error: package or namespace load failed for ‘rJava’:
.onLoad failed in loadNamespace() for 'rJava', details:
call: inDL(x, as.logical(local), as.logical(now), ...)
error: unable to load shared object 'C:/Users/danil/Documents/R/win-library/3.4/rJava/libs/x64/rJava.dll':
LoadLibrary failure: Impossibile trovare il modulo specificato.




What can i do?










share|improve this question
























  • Hi @francesco... welcome to SO. I've edited your title to be a bit more informative as a question.
    – user3603486
    Apr 7 at 19:07










  • No problem, i hope that it will also help anybody else.
    – Francesco Totti
    Apr 7 at 19:13










  • How did you install xlsx package? Or have a look here stackoverflow.com/q/37735108/5784831
    – Christoph
    Apr 7 at 19:25












  • I wasnt'able to install xlsx package... It says "Error: package or namespace load failed for ‘rJava’". I don't know what to do, i'm a newbie of R.
    – Francesco Totti
    Apr 7 at 20:26










  • What is your OS? Usually, when I get these errors, I look all over the error messages, such often there will be some libraries/packages suggested for installing for each operating system.
    – Cainã Max Couto-Silva
    Apr 8 at 3:23
















0














I apologize in advance for my bad english, i hope that someone can help me.
I have to load an Excel file .xlsx on R, but:



library(xlsx)



Error: package or namespace load failed for ‘rJava’:
.onLoad failed in loadNamespace() for 'rJava', details:
call: inDL(x, as.logical(local), as.logical(now), ...)
error: unable to load shared object 'C:/Users/danil/Documents/R/win-library/3.4/rJava/libs/x64/rJava.dll':
LoadLibrary failure: Impossibile trovare il modulo specificato.
Error: package ‘rJava’ could not be loaded




So, i tried to install Java, Java SE-Development Kit 10 and Java Runtime Environment 10, 64 bit for both. But, also in this case:



library(rJava)



Error: package or namespace load failed for ‘rJava’:
.onLoad failed in loadNamespace() for 'rJava', details:
call: inDL(x, as.logical(local), as.logical(now), ...)
error: unable to load shared object 'C:/Users/danil/Documents/R/win-library/3.4/rJava/libs/x64/rJava.dll':
LoadLibrary failure: Impossibile trovare il modulo specificato.




What can i do?










share|improve this question
























  • Hi @francesco... welcome to SO. I've edited your title to be a bit more informative as a question.
    – user3603486
    Apr 7 at 19:07










  • No problem, i hope that it will also help anybody else.
    – Francesco Totti
    Apr 7 at 19:13










  • How did you install xlsx package? Or have a look here stackoverflow.com/q/37735108/5784831
    – Christoph
    Apr 7 at 19:25












  • I wasnt'able to install xlsx package... It says "Error: package or namespace load failed for ‘rJava’". I don't know what to do, i'm a newbie of R.
    – Francesco Totti
    Apr 7 at 20:26










  • What is your OS? Usually, when I get these errors, I look all over the error messages, such often there will be some libraries/packages suggested for installing for each operating system.
    – Cainã Max Couto-Silva
    Apr 8 at 3:23














0












0








0







I apologize in advance for my bad english, i hope that someone can help me.
I have to load an Excel file .xlsx on R, but:



library(xlsx)



Error: package or namespace load failed for ‘rJava’:
.onLoad failed in loadNamespace() for 'rJava', details:
call: inDL(x, as.logical(local), as.logical(now), ...)
error: unable to load shared object 'C:/Users/danil/Documents/R/win-library/3.4/rJava/libs/x64/rJava.dll':
LoadLibrary failure: Impossibile trovare il modulo specificato.
Error: package ‘rJava’ could not be loaded




So, i tried to install Java, Java SE-Development Kit 10 and Java Runtime Environment 10, 64 bit for both. But, also in this case:



library(rJava)



Error: package or namespace load failed for ‘rJava’:
.onLoad failed in loadNamespace() for 'rJava', details:
call: inDL(x, as.logical(local), as.logical(now), ...)
error: unable to load shared object 'C:/Users/danil/Documents/R/win-library/3.4/rJava/libs/x64/rJava.dll':
LoadLibrary failure: Impossibile trovare il modulo specificato.




What can i do?










share|improve this question















I apologize in advance for my bad english, i hope that someone can help me.
I have to load an Excel file .xlsx on R, but:



library(xlsx)



Error: package or namespace load failed for ‘rJava’:
.onLoad failed in loadNamespace() for 'rJava', details:
call: inDL(x, as.logical(local), as.logical(now), ...)
error: unable to load shared object 'C:/Users/danil/Documents/R/win-library/3.4/rJava/libs/x64/rJava.dll':
LoadLibrary failure: Impossibile trovare il modulo specificato.
Error: package ‘rJava’ could not be loaded




So, i tried to install Java, Java SE-Development Kit 10 and Java Runtime Environment 10, 64 bit for both. But, also in this case:



library(rJava)



Error: package or namespace load failed for ‘rJava’:
.onLoad failed in loadNamespace() for 'rJava', details:
call: inDL(x, as.logical(local), as.logical(now), ...)
error: unable to load shared object 'C:/Users/danil/Documents/R/win-library/3.4/rJava/libs/x64/rJava.dll':
LoadLibrary failure: Impossibile trovare il modulo specificato.




What can i do?







java r






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Apr 7 at 20:52









user2554330

8,85311237




8,85311237










asked Apr 7 at 19:03









Francesco Totti

63




63












  • Hi @francesco... welcome to SO. I've edited your title to be a bit more informative as a question.
    – user3603486
    Apr 7 at 19:07










  • No problem, i hope that it will also help anybody else.
    – Francesco Totti
    Apr 7 at 19:13










  • How did you install xlsx package? Or have a look here stackoverflow.com/q/37735108/5784831
    – Christoph
    Apr 7 at 19:25












  • I wasnt'able to install xlsx package... It says "Error: package or namespace load failed for ‘rJava’". I don't know what to do, i'm a newbie of R.
    – Francesco Totti
    Apr 7 at 20:26










  • What is your OS? Usually, when I get these errors, I look all over the error messages, such often there will be some libraries/packages suggested for installing for each operating system.
    – Cainã Max Couto-Silva
    Apr 8 at 3:23


















  • Hi @francesco... welcome to SO. I've edited your title to be a bit more informative as a question.
    – user3603486
    Apr 7 at 19:07










  • No problem, i hope that it will also help anybody else.
    – Francesco Totti
    Apr 7 at 19:13










  • How did you install xlsx package? Or have a look here stackoverflow.com/q/37735108/5784831
    – Christoph
    Apr 7 at 19:25












  • I wasnt'able to install xlsx package... It says "Error: package or namespace load failed for ‘rJava’". I don't know what to do, i'm a newbie of R.
    – Francesco Totti
    Apr 7 at 20:26










  • What is your OS? Usually, when I get these errors, I look all over the error messages, such often there will be some libraries/packages suggested for installing for each operating system.
    – Cainã Max Couto-Silva
    Apr 8 at 3:23
















Hi @francesco... welcome to SO. I've edited your title to be a bit more informative as a question.
– user3603486
Apr 7 at 19:07




Hi @francesco... welcome to SO. I've edited your title to be a bit more informative as a question.
– user3603486
Apr 7 at 19:07












No problem, i hope that it will also help anybody else.
– Francesco Totti
Apr 7 at 19:13




No problem, i hope that it will also help anybody else.
– Francesco Totti
Apr 7 at 19:13












How did you install xlsx package? Or have a look here stackoverflow.com/q/37735108/5784831
– Christoph
Apr 7 at 19:25






How did you install xlsx package? Or have a look here stackoverflow.com/q/37735108/5784831
– Christoph
Apr 7 at 19:25














I wasnt'able to install xlsx package... It says "Error: package or namespace load failed for ‘rJava’". I don't know what to do, i'm a newbie of R.
– Francesco Totti
Apr 7 at 20:26




I wasnt'able to install xlsx package... It says "Error: package or namespace load failed for ‘rJava’". I don't know what to do, i'm a newbie of R.
– Francesco Totti
Apr 7 at 20:26












What is your OS? Usually, when I get these errors, I look all over the error messages, such often there will be some libraries/packages suggested for installing for each operating system.
– Cainã Max Couto-Silva
Apr 8 at 3:23




What is your OS? Usually, when I get these errors, I look all over the error messages, such often there will be some libraries/packages suggested for installing for each operating system.
– Cainã Max Couto-Silva
Apr 8 at 3:23












1 Answer
1






active

oldest

votes


















1














This was happening to me as well (also Windows 10), and the problem with mine was that the environment variable was not set properly. In my case, I had to do



Sys.setenv('JAVA_HOME' = 'C:/Program Files (x86)/Java/jre1.8.0_161/')


Just change the folder name to where Java lives in your computer, and let me know if this doesn't work out.






share|improve this answer





















  • Glad it worked out. Feel free to accept the answer if you found it useful.
    – Kim
    May 11 at 4:35










  • Do you happen to know why do we need to setenv() for JAVA_HOME in R, when I had already set JAVA_HOME in system variables? Using Windows 10
    – Digvijay Sawant
    May 14 at 17:40











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f49710941%2funable-to-load-shared-object-when-loading-the-rjava-library%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









1














This was happening to me as well (also Windows 10), and the problem with mine was that the environment variable was not set properly. In my case, I had to do



Sys.setenv('JAVA_HOME' = 'C:/Program Files (x86)/Java/jre1.8.0_161/')


Just change the folder name to where Java lives in your computer, and let me know if this doesn't work out.






share|improve this answer





















  • Glad it worked out. Feel free to accept the answer if you found it useful.
    – Kim
    May 11 at 4:35










  • Do you happen to know why do we need to setenv() for JAVA_HOME in R, when I had already set JAVA_HOME in system variables? Using Windows 10
    – Digvijay Sawant
    May 14 at 17:40
















1














This was happening to me as well (also Windows 10), and the problem with mine was that the environment variable was not set properly. In my case, I had to do



Sys.setenv('JAVA_HOME' = 'C:/Program Files (x86)/Java/jre1.8.0_161/')


Just change the folder name to where Java lives in your computer, and let me know if this doesn't work out.






share|improve this answer





















  • Glad it worked out. Feel free to accept the answer if you found it useful.
    – Kim
    May 11 at 4:35










  • Do you happen to know why do we need to setenv() for JAVA_HOME in R, when I had already set JAVA_HOME in system variables? Using Windows 10
    – Digvijay Sawant
    May 14 at 17:40














1












1








1






This was happening to me as well (also Windows 10), and the problem with mine was that the environment variable was not set properly. In my case, I had to do



Sys.setenv('JAVA_HOME' = 'C:/Program Files (x86)/Java/jre1.8.0_161/')


Just change the folder name to where Java lives in your computer, and let me know if this doesn't work out.






share|improve this answer












This was happening to me as well (also Windows 10), and the problem with mine was that the environment variable was not set properly. In my case, I had to do



Sys.setenv('JAVA_HOME' = 'C:/Program Files (x86)/Java/jre1.8.0_161/')


Just change the folder name to where Java lives in your computer, and let me know if this doesn't work out.







share|improve this answer












share|improve this answer



share|improve this answer










answered Apr 18 at 1:39









Kim

1,2511027




1,2511027












  • Glad it worked out. Feel free to accept the answer if you found it useful.
    – Kim
    May 11 at 4:35










  • Do you happen to know why do we need to setenv() for JAVA_HOME in R, when I had already set JAVA_HOME in system variables? Using Windows 10
    – Digvijay Sawant
    May 14 at 17:40


















  • Glad it worked out. Feel free to accept the answer if you found it useful.
    – Kim
    May 11 at 4:35










  • Do you happen to know why do we need to setenv() for JAVA_HOME in R, when I had already set JAVA_HOME in system variables? Using Windows 10
    – Digvijay Sawant
    May 14 at 17:40
















Glad it worked out. Feel free to accept the answer if you found it useful.
– Kim
May 11 at 4:35




Glad it worked out. Feel free to accept the answer if you found it useful.
– Kim
May 11 at 4:35












Do you happen to know why do we need to setenv() for JAVA_HOME in R, when I had already set JAVA_HOME in system variables? Using Windows 10
– Digvijay Sawant
May 14 at 17:40




Do you happen to know why do we need to setenv() for JAVA_HOME in R, when I had already set JAVA_HOME in system variables? Using Windows 10
– Digvijay Sawant
May 14 at 17:40


















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.





Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


Please pay close attention to the following guidance:


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f49710941%2funable-to-load-shared-object-when-loading-the-rjava-library%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Create new schema in PostgreSQL using DBeaver

Deepest pit of an array with Javascript: test on Codility

Costa Masnaga