Hi!
On OS X, in a terminal, if I type: /usr/bin/java -version I obtain: java version "1.8.0_66" Java(TM) SE Runtime Environment (build 1.8.0_66-b17) Java HotSpot(TM) 64-Bit Server VM (build 25.66-b17, mixed mode) Using OSSubProcess, do-it-ing the following: OSSUnixSubprocess new command: '/usr/bin/java'; arguments: #('-version'); environmentAt: 'JAVA_HOME' put: '/Library/Java/JavaVirtualMachines/jdk1.8.0_66.jdk/Contents/Home'; redirectStderr; redirectStdout; runAndWaitOnExitDo: [ :process :outString | outString inspect ]. inspect an empty string. Any idea what’s going on? Alexandre -- _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;: Alexandre Bergel http://www.bergel.eu ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;. |
java -version outputs to stderr not stdout (also I don't think you need
JAVA_HOME /usr/bin/java will do what is needed) On 20/06/2016 15:58, Alexandre Bergel wrote: > On OS X, in a terminal, if I type: /usr/bin/java -version > I obtain: > java version "1.8.0_66" > Java(TM) SE Runtime Environment (build 1.8.0_66-b17) > Java HotSpot(TM) 64-Bit Server VM (build 25.66-b17, mixed mode) > > Using OSSubProcess, do-it-ing the following: > > OSSUnixSubprocess new > command: '/usr/bin/java'; > arguments: #('-version'); > environmentAt: 'JAVA_HOME' put: '/Library/Java/JavaVirtualMachines/jdk1.8.0_66.jdk/Contents/Home'; > redirectStderr; > redirectStdout; > runAndWaitOnExitDo: [ :process :outString | > outString inspect > ]. > > inspect an empty string. > Any idea what’s going on? > -- Mark |
Hi Mark,
This is what I thought. But it does not seem to work. I tried: OSSUnixSubprocess new command: '/usr/bin/java'; arguments: #('-version'); redirectStderr; runAndWaitOnExitDo: [ :process :outString | outString inspect ]. Or is it the redirectStderr that does not work properly? Cheers, Alexandre > On Jun 20, 2016, at 11:42 AM, Mark Bestley <[hidden email]> wrote: > > java -version outputs to stderr not stdout (also I don't think you need JAVA_HOME /usr/bin/java will do what is needed) > > > > On 20/06/2016 15:58, Alexandre Bergel wrote: > >> On OS X, in a terminal, if I type: /usr/bin/java -version >> I obtain: >> java version "1.8.0_66" >> Java(TM) SE Runtime Environment (build 1.8.0_66-b17) >> Java HotSpot(TM) 64-Bit Server VM (build 25.66-b17, mixed mode) >> >> Using OSSubProcess, do-it-ing the following: >> >> OSSUnixSubprocess new >> command: '/usr/bin/java'; >> arguments: #('-version'); >> environmentAt: 'JAVA_HOME' put: '/Library/Java/JavaVirtualMachines/jdk1.8.0_66.jdk/Contents/Home'; >> redirectStderr; >> redirectStdout; >> runAndWaitOnExitDo: [ :process :outString | >> outString inspect >> ]. >> >> inspect an empty string. >> Any idea what’s going on? >> > > > > -- > Mark > > -- _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;: Alexandre Bergel http://www.bergel.eu ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;. |
#runAndWaitOnExitDo: takes a cull-ed three-arg block with the process, stdout, and stderr; that way you can process stdout and stderr independently. Try this OSSUnixSubprocess new command: '/usr/bin/java'; arguments: #('-version'); redirectStderr; runAndWaitOnExitDo: [ :process :out :err | err inspect ]. Peter On Mon, Jun 20, 2016 at 6:03 PM, Alexandre Bergel <[hidden email]> wrote: Hi Mark, |
On Mon, Jun 20, 2016 at 1:10 PM, Peter Uhnák <[hidden email]> wrote:
Exactly.
Indeed. This is what I think should work. And yes, I don't think the 'JAVA_HOME' is needed. At least for this command. Alex, let us know if Peter code worked. Cheers,
|
Yes it does! Thanks!!!
Alexandre
--
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;: Alexandre Bergel http://www.bergel.eu ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
|
Free forum by Nabble | Edit this page |