Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

run "sudo R CMD javareconf" get "Cannot find any Java interpreter"

Tags:

java

r

ubuntu

I tried to install a plugin for eclipse,but get an error,after some googling,got a suggestion to run :sudo R CMD javareconf,but got this error:

*** Cannot find any Java interpreter
*** Please make sure 'java' is on your PATH or set JAVA_HOME correspondingly

By the way,my $JAVA_HOME points to a oracle-jdk-7

like image 330
smallfish Avatar asked Oct 11 '12 12:10

smallfish


1 Answers

Most likely, your root user doesn't have a JAVA_HOME set. Do you absolutely need to sudo it?

If you do, you could use a small bash script to do it:

#!/bin/bash

export JAVA_HOME="<path to jdk>"
R CMD javareconf

Save the file and give it a name like myinstall or something like that, perform a chmod +x myinstall and sudo ./myinstall

EDIT

@Mat pointed out a good point. I changed my approach. Thanks!

like image 199
Simon Germain Avatar answered Oct 19 '22 12:10

Simon Germain