Identifying presence of Java

classic Classic list List threaded Threaded
15 messages Options
Reply | Threaded
Open this post in threaded view
|

Identifying presence of Java

Fisher Dennis
R 3.6.3
OSX and Windows

Colleagues

I want to identify if Java is installed on a particular computer.

When I execute
        Java -version
in a terminal (OSX), but not in R, there are two outcomes:
       
Java installed yields:
        java version "13.0.1" 2019-10-15
        Java(TM) SE Runtime Environment (build 13.0.1+9)
        Java HotSpot(TM) 64-Bit Server VM (build 13.0.1+9, mixed mode, sharing)

Java not installed yields:
        No Java runtime installed

I assume that there are comparable outputs in Windows.

I would like to capture this output in R using the system command, then search for “No Java runtime installed” )or the correponding text in Windows).

I execute something like:
        CAPTURE <- system("Java -version", intern=TRUE, ignore.stderr=FALSE, ignore.stdout=FALSE)
(with various permutations of TRUE/FALSE for the options) but I cannot capture what is displayed on the console.

I have also tried “system2” with various TRUE/FALSE permutations without success.

Any clever ideas?

Dennis

Dennis Fisher MD
P < (The "P Less Than" Company)
Phone / Fax: 1-866-PLessThan (1-866-753-7784)
www.PLessThan.com

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: Identifying presence of Java

Jeff Newmiller
I am mystified by your description.

A) If java is not installed, the operating system or system shell will be the source of any error associated with attempting to invoke it. That means the error message could be anything, but I find it quite surprising that the message emitted by the OS would mention "runtime". In any event, look for the output you can rely on from java for positive identification rather than looking for any consistent pattern in the error messages for negative confirmation.

B) Many OS command shells are case-sensitive... asking for the "Java" program is in that case different than asking for the "java" program.

On November 9, 2019 8:51:43 AM PST, Dennis Fisher <[hidden email]> wrote:

>R 3.6.3
>OSX and Windows
>
>Colleagues
>
>I want to identify if Java is installed on a particular computer.
>
>When I execute
> Java -version
>in a terminal (OSX), but not in R, there are two outcomes:
>
>Java installed yields:
> java version "13.0.1" 2019-10-15
> Java(TM) SE Runtime Environment (build 13.0.1+9)
> Java HotSpot(TM) 64-Bit Server VM (build 13.0.1+9, mixed mode,
>sharing)
>
>Java not installed yields:
> No Java runtime installed
>
>I assume that there are comparable outputs in Windows.
>
>I would like to capture this output in R using the system command, then
>search for “No Java runtime installed” )or the correponding text in
>Windows).
>
>I execute something like:
> CAPTURE <- system("Java -version", intern=TRUE, ignore.stderr=FALSE,
>ignore.stdout=FALSE)
>(with various permutations of TRUE/FALSE for the options) but I cannot
>capture what is displayed on the console.
>
>I have also tried “system2” with various TRUE/FALSE permutations
>without success.
>
>Any clever ideas?
>
>Dennis
>
>Dennis Fisher MD
>P < (The "P Less Than" Company)
>Phone / Fax: 1-866-PLessThan (1-866-753-7784)
>www.PLessThan.com
>
>______________________________________________
>[hidden email] mailing list -- To UNSUBSCRIBE and more, see
>https://stat.ethz.ch/mailman/listinfo/r-help
>PLEASE do read the posting guide
>http://www.R-project.org/posting-guide.html
>and provide commented, minimal, self-contained, reproducible code.

--
Sent from my phone. Please excuse my brevity.

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: Identifying presence of Java

Fisher Dennis
Jeff

A.  I can certainly look for the output from Java — but that was not the point — nothing was captured to CAPTURE with either scenarios.
B.  I tried changing case — that did not solve the problem.

The issue remains — when I execute the system command, the text output that I presented below is not being displayed.  
Is there a way to capture that output?  If so, I can certainly figure out how to parse it.

Dennis


Dennis Fisher MD
P < (The "P Less Than" Company)
Phone / Fax: 1-866-PLessThan (1-866-753-7784)
www.PLessThan.com <http://www.plessthan.com/>




> On Nov 9, 2019, at 9:28 AM, Jeff Newmiller <[hidden email]> wrote:
>
> I am mystified by your description.
>
> A) If java is not installed, the operating system or system shell will be the source of any error associated with attempting to invoke it. That means the error message could be anything, but I find it quite surprising that the message emitted by the OS would mention "runtime". In any event, look for the output you can rely on from java for positive identification rather than looking for any consistent pattern in the error messages for negative confirmation.
>
> B) Many OS command shells are case-sensitive... asking for the "Java" program is in that case different than asking for the "java" program.
>
> On November 9, 2019 8:51:43 AM PST, Dennis Fisher <[hidden email]> wrote:
>> R 3.6.3
>> OSX and Windows
>>
>> Colleagues
>>
>> I want to identify if Java is installed on a particular computer.
>>
>> When I execute
>> Java -version
>> in a terminal (OSX), but not in R, there are two outcomes:
>>
>> Java installed yields:
>> java version "13.0.1" 2019-10-15
>> Java(TM) SE Runtime Environment (build 13.0.1+9)
>> Java HotSpot(TM) 64-Bit Server VM (build 13.0.1+9, mixed mode,
>> sharing)
>>
>> Java not installed yields:
>> No Java runtime installed
>>
>> I assume that there are comparable outputs in Windows.
>>
>> I would like to capture this output in R using the system command, then
>> search for “No Java runtime installed” )or the correponding text in
>> Windows).
>>
>> I execute something like:
>> CAPTURE <- system("Java -version", intern=TRUE, ignore.stderr=FALSE,
>> ignore.stdout=FALSE)
>> (with various permutations of TRUE/FALSE for the options) but I cannot
>> capture what is displayed on the console.
>>
>> I have also tried “system2” with various TRUE/FALSE permutations
>> without success.
>>
>> Any clever ideas?
>>
>> Dennis
>>
>> Dennis Fisher MD
>> P < (The "P Less Than" Company)
>> Phone / Fax: 1-866-PLessThan (1-866-753-7784)
>> www.PLessThan.com
>>
>> ______________________________________________
>> [hidden email] mailing list -- To UNSUBSCRIBE and more, see
>> https://stat.ethz.ch/mailman/listinfo/r-help
>> PLEASE do read the posting guide
>> http://www.R-project.org/posting-guide.html
>> and provide commented, minimal, self-contained, reproducible code.
>
> --
> Sent from my phone. Please excuse my brevity.


        [[alternative HTML version deleted]]

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: Identifying presence of Java

Dirk Eddelbuettel
In reply to this post by Fisher Dennis

Dennis,

R does that for you already as it needs to know it for rJava too.

On my (Linux) box:

  edd@rob:~$ R CMD config JAVA
  /usr/lib/jvm/default-java/bin/java
  edd@rob:~$ R CMD config JAVA_HOME
  /usr/lib/jvm/default-java
  edd@rob:~$

You could also do the equivalent of `which` or `type -p` from R:

  R> Sys.which("javac")
             javac
  "/usr/bin/javac"
  R> Sys.which("javacdoesnotexist")
  javacdoesnotexist
               ""
  R>

Hope this helps, Dirk

--
http://dirk.eddelbuettel.com | @eddelbuettel | [hidden email]

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: Identifying presence of Java

Rui Barradas
In reply to this post by Fisher Dennis
Hello,

Here are two ways.

1. system2 returns the return value of the shell command so if Java is
installed, it should return 0. In the first call it's 'java' (lowercase
j), in the second 'Java' (uppercase J).

java <- system2('java', '-version')
java
#[1] 0

Java <- system2('Java', '-version')
Java
#[1] 127


2.
Another way is to redirect the shell output to file. In this case I'm
redirecting to a temp file. Then, readLines from that file.

tmpfile <- tempfile()
if(!dir.exists(dirname(tmpfile))) dir.create(dirname(tmpfile))

system2('java', '-version', '>', tmpfile)
readLines(tmpfile)

unlink(tmpfile)  # final cleanup


Hope this helps,

Rui Barradas


Às 16:51 de 09/11/19, Dennis Fisher escreveu:

> R 3.6.3
> OSX and Windows
>
> Colleagues
>
> I want to identify if Java is installed on a particular computer.
>
> When I execute
> Java -version
> in a terminal (OSX), but not in R, there are two outcomes:
>
> Java installed yields:
> java version "13.0.1" 2019-10-15
> Java(TM) SE Runtime Environment (build 13.0.1+9)
> Java HotSpot(TM) 64-Bit Server VM (build 13.0.1+9, mixed mode, sharing)
>
> Java not installed yields:
> No Java runtime installed
>
> I assume that there are comparable outputs in Windows.
>
> I would like to capture this output in R using the system command, then search for “No Java runtime installed” )or the correponding text in Windows).
>
> I execute something like:
> CAPTURE <- system("Java -version", intern=TRUE, ignore.stderr=FALSE, ignore.stdout=FALSE)
> (with various permutations of TRUE/FALSE for the options) but I cannot capture what is displayed on the console.
>
> I have also tried “system2” with various TRUE/FALSE permutations without success.
>
> Any clever ideas?
>
> Dennis
>
> Dennis Fisher MD
> P < (The "P Less Than" Company)
> Phone / Fax: 1-866-PLessThan (1-866-753-7784)
> www.PLessThan.com
>
> ______________________________________________
> [hidden email] mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: Identifying presence of Java

Duncan Murdoch-2
In reply to this post by Fisher Dennis
On 09/11/2019 12:33 p.m., Dennis Fisher wrote:
> Jeff
>
> A.  I can certainly look for the output from Java — but that was not the point — nothing was captured to CAPTURE with either scenarios.
> B.  I tried changing case — that did not solve the problem.
>
> The issue remains — when I execute the system command, the text output that I presented below is not being displayed.
> Is there a way to capture that output?  If so, I can certainly figure out how to parse it.

These seem to work for me:

  system("Java -version 2>&1", intern = TRUE)

  system2("Java","-version", stdout = TRUE, stderr = TRUE)

These are based on reading the help pages, which sometimes helps.

Duncan Murdoch

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: Identifying presence of Java

Berry, Charles
In reply to this post by Fisher Dennis


> On Nov 9, 2019, at 8:51 AM, Dennis Fisher <[hidden email]> wrote:
>
> R 3.6.3
> OSX and Windows
>
> Colleagues
>
> I want to identify if Java is installed on a particular computer.
>


[...]

> I execute something like:
> CAPTURE <- system("Java -version", intern=TRUE, ignore.stderr=FALSE, ignore.stdout=FALSE)
> (with various permutations of TRUE/FALSE for the options) but I cannot capture what is displayed on the console.
>
> I have also tried “system2” with various TRUE/FALSE permutations without success.
>
> Any clever ideas?
>

?Sys.which

HTH,

CCB

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: Identifying presence of Java

Fisher Dennis
In reply to this post by Dirk Eddelbuettel
Dirk

I am now more confused (and I appreciate your help in sorting this out).  

I executed
        require(“rJava”)
and received the following error:

> 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 '/Library/Frameworks/R.framework/Versions/3.6/Resources/library/rJava/libs/rJava.so':
>   dlopen(/Library/Frameworks/R.framework/Versions/3.6/Resources/library/rJava/libs/rJava.so, 6): Library not loaded: /Library/Java/JavaVirtualMachines/jdk-11.0.1.jdk/Contents/Home/lib/server/libjvm.dylib
>   Referenced from: /Library/Frameworks/R.framework/Versions/3.6/Resources/library/rJava/libs/rJava.so
>   Reason: image not found
>
Java is definitely installed on this machine — from a terminal:
        PET513> Java -version
        java version "13.0.1" 2019-10-15
        Java(TM) SE Runtime Environment (build 13.0.1+9)
        Java HotSpot(TM) 64-Bit Server VM (build 13.0.1+9, mixed mode, sharing)

It appears that the problem relates to version # — I have 13.03.1 installed whereas R is looking for 11.0.1

Any idea how to fix this?

Dennis

Dennis Fisher MD
P < (The "P Less Than" Company)
Phone / Fax: 1-866-PLessThan (1-866-753-7784)
www.PLessThan.com




> On Nov 9, 2019, at 9:35 AM, Dirk Eddelbuettel <[hidden email]> wrote:
>
>
> Dennis,
>
> R does that for you already as it needs to know it for rJava too.
>
> On my (Linux) box:
>
>  edd@rob:~$ R CMD config JAVA
>  /usr/lib/jvm/default-java/bin/java
>  edd@rob:~$ R CMD config JAVA_HOME
>  /usr/lib/jvm/default-java
>  edd@rob:~$
>
> You could also do the equivalent of `which` or `type -p` from R:
>
>  R> Sys.which("javac")
>             javac
>  "/usr/bin/javac"
>  R> Sys.which("javacdoesnotexist")
>  javacdoesnotexist
>               ""
>  R>
>
> Hope this helps, Dirk
>
> --
> http://dirk.eddelbuettel.com | @eddelbuettel | [hidden email]

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: Identifying presence of Java

Abby Spurdle
In reply to this post by Fisher Dennis
> I would like to capture this output in R using the system command, then search for “No Java runtime installed” )or the correponding text in Windows).
>
> I execute something like:
>         CAPTURE <- system("Java -version", intern=TRUE, ignore.stderr=FALSE, ignore.stdout=FALSE)
> (with various permutations of TRUE/FALSE for the options) but I cannot capture what is displayed on the console.

That's fascinating...
I'm offsite, I'll try it tomorrow...

Two questions:
(1) What is the value of CAPTURE (or does it hang)?
(2) Can you run other java commands ("java MyClass", "javac MyClass.java", etc)?

Another thing, did you try Duncan's suggestion?
If that doesn't work, another possibility is to pipe the output, to a
command line app that echos the text.

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: Identifying presence of Java

Abby Spurdle
> (2) Can you run other java commands ("java MyClass", "javac MyClass.java", etc)?

Sorry, I meant to say, can you capture the output from other jdk commands?

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: Identifying presence of Java

Rui Barradas
In reply to this post by Fisher Dennis
Hello,

This error can be a 32 bits vs 64 bits thing. R and java must have the
same architecture. If you have 64b Java installed, don't run 32b R. And
vice-versa.

Hope this helps,

Rui Barradas

Às 18:53 de 09/11/19, Dennis Fisher escreveu:

> Dirk
>
> I am now more confused (and I appreciate your help in sorting this out).
>
> I executed
> require(“rJava”)
> and received the following error:
>
>> 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 '/Library/Frameworks/R.framework/Versions/3.6/Resources/library/rJava/libs/rJava.so':
>>    dlopen(/Library/Frameworks/R.framework/Versions/3.6/Resources/library/rJava/libs/rJava.so, 6): Library not loaded: /Library/Java/JavaVirtualMachines/jdk-11.0.1.jdk/Contents/Home/lib/server/libjvm.dylib
>>    Referenced from: /Library/Frameworks/R.framework/Versions/3.6/Resources/library/rJava/libs/rJava.so
>>    Reason: image not found
>>
> Java is definitely installed on this machine — from a terminal:
> PET513> Java -version
> java version "13.0.1" 2019-10-15
> Java(TM) SE Runtime Environment (build 13.0.1+9)
> Java HotSpot(TM) 64-Bit Server VM (build 13.0.1+9, mixed mode, sharing)
>
> It appears that the problem relates to version # — I have 13.03.1 installed whereas R is looking for 11.0.1
>
> Any idea how to fix this?
>
> Dennis
>
> Dennis Fisher MD
> P < (The "P Less Than" Company)
> Phone / Fax: 1-866-PLessThan (1-866-753-7784)
> www.PLessThan.com
>
>
>
>
>> On Nov 9, 2019, at 9:35 AM, Dirk Eddelbuettel <[hidden email]> wrote:
>>
>>
>> Dennis,
>>
>> R does that for you already as it needs to know it for rJava too.
>>
>> On my (Linux) box:
>>
>>   edd@rob:~$ R CMD config JAVA
>>   /usr/lib/jvm/default-java/bin/java
>>   edd@rob:~$ R CMD config JAVA_HOME
>>   /usr/lib/jvm/default-java
>>   edd@rob:~$
>>
>> You could also do the equivalent of `which` or `type -p` from R:
>>
>>   R> Sys.which("javac")
>>              javac
>>   "/usr/bin/javac"
>>   R> Sys.which("javacdoesnotexist")
>>   javacdoesnotexist
>>                ""
>>   R>
>>
>> Hope this helps, Dirk
>>
>> --
>> http://dirk.eddelbuettel.com | @eddelbuettel | [hidden email]
>
> ______________________________________________
> [hidden email] mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: Identifying presence of Java

Dirk Eddelbuettel
In reply to this post by Fisher Dennis

Dennis,

On 9 November 2019 at 10:53, Dennis Fisher wrote:
| Dirk
|
| I am now more confused (and I appreciate your help in sorting this out).  
|
| I executed
| require(“rJava”)
| and received the following error:
|
| > 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 '/Library/Frameworks/R.framework/Versions/3.6/Resources/library/rJava/libs/rJava.so':
| >   dlopen(/Library/Frameworks/R.framework/Versions/3.6/Resources/library/rJava/libs/rJava.so, 6): Library not loaded: /Library/Java/JavaVirtualMachines/jdk-11.0.1.jdk/Contents/Home/lib/server/libjvm.dylib
| >   Referenced from: /Library/Frameworks/R.framework/Versions/3.6/Resources/library/rJava/libs/rJava.so
| >   Reason: image not found
| >
| Java is definitely installed on this machine — from a terminal:
| PET513> Java -version
| java version "13.0.1" 2019-10-15
| Java(TM) SE Runtime Environment (build 13.0.1+9)
| Java HotSpot(TM) 64-Bit Server VM (build 13.0.1+9, mixed mode, sharing)
|
| It appears that the problem relates to version # — I have 13.03.1 installed whereas R is looking for 11.0.1
|
| Any idea how to fix this?

I have seen this happen when the Java settings changed from a different
version which can happen.  The common fix is to

   R CMD javareconf

to updated R's settings about Java. (This step also happens when you rebuild
R; but rebuilding R is typically not required; we just want updated Java
settings).

If that is done, and your Java installation is otherwise sufficient then

   R CMD INSTALL rJava_*tar.gz

(or equally from within R)  should do the trick.

Dirk

--
http://dirk.eddelbuettel.com | @eddelbuettel | [hidden email]

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: Identifying presence of Java

Abby Spurdle
In reply to this post by Duncan Murdoch-2
> These seem to work for me:
>   system("Java -version 2>&1", intern = TRUE)
>
>   system2("Java","-version", stdout = TRUE, stderr = TRUE)
>

Hi Dennis

I tried your example and Duncan's examples.
In your example, I get zero.
The second of Duncan's examples worked for me, but not the first.

I've got a suspicion that java is writing in unicode, but R is
expecting another format, however, I could be completely wrong on
that.

The following also worked for me:
CAPTURE = shell ("Java -version 2>&1", intern=TRUE)

Abs

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: Identifying presence of Java

Fisher Dennis
Abby

I assume that your OS in Windows — shell is Windows only.  Fortunately, it appears that the changing “shell” to “system” works in OS X.
So, now I have a solution for both OSs.  

This issue was a prelude to a larger issue that I will address in a separate email.

Thanks to everyone for their suggestions.

Dennis

Dennis Fisher MD
P < (The "P Less Than" Company)
Phone / Fax: 1-866-PLessThan (1-866-753-7784)
www.PLessThan.com <http://www.plessthan.com/>




> On Nov 10, 2019, at 11:49 AM, Abby Spurdle <[hidden email]> wrote:
>
>  shell ("Java -version 2>&1", intern=TRUE)


        [[alternative HTML version deleted]]

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: Identifying presence of Java

Simon Urbanek
FWIW you cannot assume that java will be on the PATH - especially on Windows it typically is not. That’s why rJava uses registry on Windows to find the Java location. For other platforms there is
R CMD config JAVA

Cheers,
Simon


> On Nov 10, 2019, at 3:26 PM, Dennis Fisher <[hidden email]> wrote:
>
> Abby
>
> I assume that your OS in Windows — shell is Windows only.  Fortunately, it appears that the changing “shell” to “system” works in OS X.
> So, now I have a solution for both OSs.  
>
> This issue was a prelude to a larger issue that I will address in a separate email.
>
> Thanks to everyone for their suggestions.
>
> Dennis
>
> Dennis Fisher MD
> P < (The "P Less Than" Company)
> Phone / Fax: 1-866-PLessThan (1-866-753-7784)
> www.PLessThan.com <http://www.plessthan.com/>
>
>
>
>
>> On Nov 10, 2019, at 11:49 AM, Abby Spurdle <[hidden email]> wrote:
>>
>> shell ("Java -version 2>&1", intern=TRUE)
>
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> [hidden email] mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.