Not able to install rJava in R
![Creative The name of the picture](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgO9GURib1T8z7lCwjOGLQaGtrueEthgQ8LO42ZX8cOfTqDK4jvDDpKkLFwf2J49kYCMNW7d4ABih_XCb_2UXdq5fPJDkoyg7-8g_YfRUot-XnaXkNYycsNp7lA5_TW9td0FFpLQ2APzKcZ/s1600/1.jpg)
![Creative The name of the picture](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhYQ0N5W1qAOxLP7t7iOM6O6AzbZnkXUy16s7P_CWfOb5UbTQY_aDsc727chyphenhyphen5W4IppVNernMMQeaUFTB_rFzAd95_CDt-tnwN-nBx6JyUp2duGjPaL5-VgNO41AVsA_vu30EJcipdDG409/s400/Clash+Royale+CLAN+TAG%2523URR8PPP.png)
up vote
0
down vote
favorite
I am not able to install the rJava package in R.
If I run sudo R CMD javareconf
:
*** JAVA_HOME is not a valid path, ignoring
Java interpreter : /usr/bin/java
Java version : 1.8.0_161
Java home path : /usr/lib/jvm/java-8-oracle/jre
Java compiler : /usr/bin/javac
Java headers gen.: /usr/bin/javah
Java archive tool: /usr/bin/jar
trying to compile and link a JNI program
detected JNI cpp flags : -I$(JAVA_HOME)/../include -
I$(JAVA_HOME)/../include/linux
detected JNI linker flags : -L$(JAVA_HOME)/lib/amd64/server -ljvm
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG -I/usr/lib/jvm/java-8-
oracle/jre/../include -I/usr/lib/jvm/java-8-
oracle/jre/../include/linux
-fpic -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -
Werror=format-security -D_FORTIFY_SOURCE=2 -g -c conftest.c -o
conftest.o
g++ -shared -L/usr/lib/R/lib -Wl,-Bsymbolic-functions -Wl,-z,relro -o
conftest.so conftest.o -L/usr/lib/jvm/java-8-
oracle/jre/lib/amd64/server -ljvm -L/usr/lib/R/lib -lR
JAVA_HOME : /usr/lib/jvm/java-8-oracle/jre
Java library path: $(JAVA_HOME)/lib/amd64/server
JNI cpp flags : -I$(JAVA_HOME)/../include -
I$(JAVA_HOME)/../include/linux
JNI linker flags : -L$(JAVA_HOME)/lib/amd64/server -ljvm
Updating Java configuration in /usr/lib/R
Done.
I have also ran the following commands:
export JAVA_HOME=/usr/lib/jvm/java-8-oracle
export PATH=$PATH:$JAVA_HOME/bin
but I don't really know what it is supposed to do...
Finally, it has to be mentioned that
if I install and run rJava (using library(rJava)) in sudo mode everything is ok.
if I run rJava in normal user mode with
library(rJava)
I get the following error:
library(rJava)
Error: package or namespace load failed for âÂÂrJavaâÂÂ:
.onLoad failed in loadNamespace() for 'rJava', details:
call: dyn.load(file, DLLpath = DLLpath, ...)
error: unable to load shared object '/home/marc/R/x86_64-pc-linux-
gnu-library/3.4/rJava/libs/rJava.so':
libjvm.so: cannot open shared object file: No such file or directoryIf I try to install rJava in normal user mode I get the same error as the previous when testing if package can be loaded:
** testing if installed package can be loaded
Error: package or namespace load failed for âÂÂrJavaâÂÂ:
.onLoad failed in loadNamespace() for 'rJava', details:
call: dyn.load(file, DLLpath = DLLpath, ...)
error: unable to load shared object '/home/marc/R/x86_64-pc-linux-
gnu-library/3.4/rJava/libs/rJava.so':
libjvm.so: cannot open shared object file: No such file or directory
Error: loading failed
Execution halted
Any help would be welcome.
16.04 software-installation java r
add a comment |Â
up vote
0
down vote
favorite
I am not able to install the rJava package in R.
If I run sudo R CMD javareconf
:
*** JAVA_HOME is not a valid path, ignoring
Java interpreter : /usr/bin/java
Java version : 1.8.0_161
Java home path : /usr/lib/jvm/java-8-oracle/jre
Java compiler : /usr/bin/javac
Java headers gen.: /usr/bin/javah
Java archive tool: /usr/bin/jar
trying to compile and link a JNI program
detected JNI cpp flags : -I$(JAVA_HOME)/../include -
I$(JAVA_HOME)/../include/linux
detected JNI linker flags : -L$(JAVA_HOME)/lib/amd64/server -ljvm
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG -I/usr/lib/jvm/java-8-
oracle/jre/../include -I/usr/lib/jvm/java-8-
oracle/jre/../include/linux
-fpic -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -
Werror=format-security -D_FORTIFY_SOURCE=2 -g -c conftest.c -o
conftest.o
g++ -shared -L/usr/lib/R/lib -Wl,-Bsymbolic-functions -Wl,-z,relro -o
conftest.so conftest.o -L/usr/lib/jvm/java-8-
oracle/jre/lib/amd64/server -ljvm -L/usr/lib/R/lib -lR
JAVA_HOME : /usr/lib/jvm/java-8-oracle/jre
Java library path: $(JAVA_HOME)/lib/amd64/server
JNI cpp flags : -I$(JAVA_HOME)/../include -
I$(JAVA_HOME)/../include/linux
JNI linker flags : -L$(JAVA_HOME)/lib/amd64/server -ljvm
Updating Java configuration in /usr/lib/R
Done.
I have also ran the following commands:
export JAVA_HOME=/usr/lib/jvm/java-8-oracle
export PATH=$PATH:$JAVA_HOME/bin
but I don't really know what it is supposed to do...
Finally, it has to be mentioned that
if I install and run rJava (using library(rJava)) in sudo mode everything is ok.
if I run rJava in normal user mode with
library(rJava)
I get the following error:
library(rJava)
Error: package or namespace load failed for âÂÂrJavaâÂÂ:
.onLoad failed in loadNamespace() for 'rJava', details:
call: dyn.load(file, DLLpath = DLLpath, ...)
error: unable to load shared object '/home/marc/R/x86_64-pc-linux-
gnu-library/3.4/rJava/libs/rJava.so':
libjvm.so: cannot open shared object file: No such file or directoryIf I try to install rJava in normal user mode I get the same error as the previous when testing if package can be loaded:
** testing if installed package can be loaded
Error: package or namespace load failed for âÂÂrJavaâÂÂ:
.onLoad failed in loadNamespace() for 'rJava', details:
call: dyn.load(file, DLLpath = DLLpath, ...)
error: unable to load shared object '/home/marc/R/x86_64-pc-linux-
gnu-library/3.4/rJava/libs/rJava.so':
libjvm.so: cannot open shared object file: No such file or directory
Error: loading failed
Execution halted
Any help would be welcome.
16.04 software-installation java r
I am not sure whetherJAVA_HOME is not a valid path, ignoring
is important here but have you checked that/usr/lib/jvm/java-8-oracle
you are setting asJAVA_HOME
is a valid path in your system and contains a Java installation? If you are following an online guide, please provide a link in your question.
â Melebius
Apr 26 at 10:02
add a comment |Â
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I am not able to install the rJava package in R.
If I run sudo R CMD javareconf
:
*** JAVA_HOME is not a valid path, ignoring
Java interpreter : /usr/bin/java
Java version : 1.8.0_161
Java home path : /usr/lib/jvm/java-8-oracle/jre
Java compiler : /usr/bin/javac
Java headers gen.: /usr/bin/javah
Java archive tool: /usr/bin/jar
trying to compile and link a JNI program
detected JNI cpp flags : -I$(JAVA_HOME)/../include -
I$(JAVA_HOME)/../include/linux
detected JNI linker flags : -L$(JAVA_HOME)/lib/amd64/server -ljvm
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG -I/usr/lib/jvm/java-8-
oracle/jre/../include -I/usr/lib/jvm/java-8-
oracle/jre/../include/linux
-fpic -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -
Werror=format-security -D_FORTIFY_SOURCE=2 -g -c conftest.c -o
conftest.o
g++ -shared -L/usr/lib/R/lib -Wl,-Bsymbolic-functions -Wl,-z,relro -o
conftest.so conftest.o -L/usr/lib/jvm/java-8-
oracle/jre/lib/amd64/server -ljvm -L/usr/lib/R/lib -lR
JAVA_HOME : /usr/lib/jvm/java-8-oracle/jre
Java library path: $(JAVA_HOME)/lib/amd64/server
JNI cpp flags : -I$(JAVA_HOME)/../include -
I$(JAVA_HOME)/../include/linux
JNI linker flags : -L$(JAVA_HOME)/lib/amd64/server -ljvm
Updating Java configuration in /usr/lib/R
Done.
I have also ran the following commands:
export JAVA_HOME=/usr/lib/jvm/java-8-oracle
export PATH=$PATH:$JAVA_HOME/bin
but I don't really know what it is supposed to do...
Finally, it has to be mentioned that
if I install and run rJava (using library(rJava)) in sudo mode everything is ok.
if I run rJava in normal user mode with
library(rJava)
I get the following error:
library(rJava)
Error: package or namespace load failed for âÂÂrJavaâÂÂ:
.onLoad failed in loadNamespace() for 'rJava', details:
call: dyn.load(file, DLLpath = DLLpath, ...)
error: unable to load shared object '/home/marc/R/x86_64-pc-linux-
gnu-library/3.4/rJava/libs/rJava.so':
libjvm.so: cannot open shared object file: No such file or directoryIf I try to install rJava in normal user mode I get the same error as the previous when testing if package can be loaded:
** testing if installed package can be loaded
Error: package or namespace load failed for âÂÂrJavaâÂÂ:
.onLoad failed in loadNamespace() for 'rJava', details:
call: dyn.load(file, DLLpath = DLLpath, ...)
error: unable to load shared object '/home/marc/R/x86_64-pc-linux-
gnu-library/3.4/rJava/libs/rJava.so':
libjvm.so: cannot open shared object file: No such file or directory
Error: loading failed
Execution halted
Any help would be welcome.
16.04 software-installation java r
I am not able to install the rJava package in R.
If I run sudo R CMD javareconf
:
*** JAVA_HOME is not a valid path, ignoring
Java interpreter : /usr/bin/java
Java version : 1.8.0_161
Java home path : /usr/lib/jvm/java-8-oracle/jre
Java compiler : /usr/bin/javac
Java headers gen.: /usr/bin/javah
Java archive tool: /usr/bin/jar
trying to compile and link a JNI program
detected JNI cpp flags : -I$(JAVA_HOME)/../include -
I$(JAVA_HOME)/../include/linux
detected JNI linker flags : -L$(JAVA_HOME)/lib/amd64/server -ljvm
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG -I/usr/lib/jvm/java-8-
oracle/jre/../include -I/usr/lib/jvm/java-8-
oracle/jre/../include/linux
-fpic -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -
Werror=format-security -D_FORTIFY_SOURCE=2 -g -c conftest.c -o
conftest.o
g++ -shared -L/usr/lib/R/lib -Wl,-Bsymbolic-functions -Wl,-z,relro -o
conftest.so conftest.o -L/usr/lib/jvm/java-8-
oracle/jre/lib/amd64/server -ljvm -L/usr/lib/R/lib -lR
JAVA_HOME : /usr/lib/jvm/java-8-oracle/jre
Java library path: $(JAVA_HOME)/lib/amd64/server
JNI cpp flags : -I$(JAVA_HOME)/../include -
I$(JAVA_HOME)/../include/linux
JNI linker flags : -L$(JAVA_HOME)/lib/amd64/server -ljvm
Updating Java configuration in /usr/lib/R
Done.
I have also ran the following commands:
export JAVA_HOME=/usr/lib/jvm/java-8-oracle
export PATH=$PATH:$JAVA_HOME/bin
but I don't really know what it is supposed to do...
Finally, it has to be mentioned that
if I install and run rJava (using library(rJava)) in sudo mode everything is ok.
if I run rJava in normal user mode with
library(rJava)
I get the following error:
library(rJava)
Error: package or namespace load failed for âÂÂrJavaâÂÂ:
.onLoad failed in loadNamespace() for 'rJava', details:
call: dyn.load(file, DLLpath = DLLpath, ...)
error: unable to load shared object '/home/marc/R/x86_64-pc-linux-
gnu-library/3.4/rJava/libs/rJava.so':
libjvm.so: cannot open shared object file: No such file or directoryIf I try to install rJava in normal user mode I get the same error as the previous when testing if package can be loaded:
** testing if installed package can be loaded
Error: package or namespace load failed for âÂÂrJavaâÂÂ:
.onLoad failed in loadNamespace() for 'rJava', details:
call: dyn.load(file, DLLpath = DLLpath, ...)
error: unable to load shared object '/home/marc/R/x86_64-pc-linux-
gnu-library/3.4/rJava/libs/rJava.so':
libjvm.so: cannot open shared object file: No such file or directory
Error: loading failed
Execution halted
Any help would be welcome.
16.04 software-installation java r
edited Apr 26 at 10:00
Melebius
3,74841636
3,74841636
asked Apr 26 at 9:20
marc
62
62
I am not sure whetherJAVA_HOME is not a valid path, ignoring
is important here but have you checked that/usr/lib/jvm/java-8-oracle
you are setting asJAVA_HOME
is a valid path in your system and contains a Java installation? If you are following an online guide, please provide a link in your question.
â Melebius
Apr 26 at 10:02
add a comment |Â
I am not sure whetherJAVA_HOME is not a valid path, ignoring
is important here but have you checked that/usr/lib/jvm/java-8-oracle
you are setting asJAVA_HOME
is a valid path in your system and contains a Java installation? If you are following an online guide, please provide a link in your question.
â Melebius
Apr 26 at 10:02
I am not sure whether
JAVA_HOME is not a valid path, ignoring
is important here but have you checked that /usr/lib/jvm/java-8-oracle
you are setting as JAVA_HOME
is a valid path in your system and contains a Java installation? If you are following an online guide, please provide a link in your question.â Melebius
Apr 26 at 10:02
I am not sure whether
JAVA_HOME is not a valid path, ignoring
is important here but have you checked that /usr/lib/jvm/java-8-oracle
you are setting as JAVA_HOME
is a valid path in your system and contains a Java installation? If you are following an online guide, please provide a link in your question.â Melebius
Apr 26 at 10:02
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
0
down vote
Try:
update-alternatives --config java
This gave an output like this:
- 2 /usr/lib/jvm/java-8-oracle/jre/bin/java
Add to your /etc/environment
JAVA_HOME='/usr/lib/jvm/java-8-oracle'
And then remove and reinstall r-base:
sudo apt-get remove r-base
sudo apt-get install r-base
Now try install rJava again.
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
Try:
update-alternatives --config java
This gave an output like this:
- 2 /usr/lib/jvm/java-8-oracle/jre/bin/java
Add to your /etc/environment
JAVA_HOME='/usr/lib/jvm/java-8-oracle'
And then remove and reinstall r-base:
sudo apt-get remove r-base
sudo apt-get install r-base
Now try install rJava again.
add a comment |Â
up vote
0
down vote
Try:
update-alternatives --config java
This gave an output like this:
- 2 /usr/lib/jvm/java-8-oracle/jre/bin/java
Add to your /etc/environment
JAVA_HOME='/usr/lib/jvm/java-8-oracle'
And then remove and reinstall r-base:
sudo apt-get remove r-base
sudo apt-get install r-base
Now try install rJava again.
add a comment |Â
up vote
0
down vote
up vote
0
down vote
Try:
update-alternatives --config java
This gave an output like this:
- 2 /usr/lib/jvm/java-8-oracle/jre/bin/java
Add to your /etc/environment
JAVA_HOME='/usr/lib/jvm/java-8-oracle'
And then remove and reinstall r-base:
sudo apt-get remove r-base
sudo apt-get install r-base
Now try install rJava again.
Try:
update-alternatives --config java
This gave an output like this:
- 2 /usr/lib/jvm/java-8-oracle/jre/bin/java
Add to your /etc/environment
JAVA_HOME='/usr/lib/jvm/java-8-oracle'
And then remove and reinstall r-base:
sudo apt-get remove r-base
sudo apt-get install r-base
Now try install rJava again.
edited Apr 27 at 18:10
answered Apr 27 at 18:05
cybrd0g
11
11
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1028336%2fnot-able-to-install-rjava-in-r%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
I am not sure whether
JAVA_HOME is not a valid path, ignoring
is important here but have you checked that/usr/lib/jvm/java-8-oracle
you are setting asJAVA_HOME
is a valid path in your system and contains a Java installation? If you are following an online guide, please provide a link in your question.â Melebius
Apr 26 at 10:02