Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.programmer > #8238
| From | Daniel Pitts <newsgroup.nospam@virtualinfinity.net> |
|---|---|
| Newsgroups | comp.lang.java.programmer |
| Subject | Re: Java Runtime getRuntime().exec not work in AIX |
| References | <da7da6db-b203-41eb-b217-5505afd20d28@i21g2000yqk.googlegroups.com> <oaOeq.47453$OO1.35443@newsfe02.iad> <46f9831d-ee3f-4448-9d8c-ef5b89be8ea5@i5g2000vbw.googlegroups.com> |
| Message-ID | <ld3fq.27464$eS.2015@newsfe03.iad> (permalink) |
| Date | 2011-09-23 10:20 -0700 |
On 9/23/11 7:31 AM, SamuelXiao wrote:
> On Sep 23, 5:56 am, Daniel Pitts
> <newsgroup.nos...@virtualinfinity.net> wrote:
>> On 9/22/11 8:09 AM, SamuelXiao wrote:
>>
>>
>>
>>
>>
>>
>>
>>> Hi All,
>>
>>> I have a Java program that needs to run a command in AIX environment.
>>> The code is as follows:
>>
>>> String[] cmds ={"/bin/ksh","-c","uuencode /log/test.log attached.log |
>>> mailx -s 'Testing' a...@example.com "};
>>> Process process = Runtime.getRuntime().exec(cmds);
>>
>>> But I found that it does not work, the cmd is fine because I have
>>> tried it in AIX without using these code. It seems that AIX does not
>>> allow the process to be created?
>>
>>> Does anyone know if there is any configuration to allow it in AIX? I
>>> have also post this question in the AIX forum.
>>
>>> Any help would be highly appreciated.
>>
>> Read the javadocs for process. You need to have something reading the
>> stdout/stderr, or they may block when the buffer fills.
>>
>> Also, consider using ProcessBuilder instead.
>>
>> <http://download.oracle.com/javase/7/docs/api/java/lang/ProcessBuilder...>
>
> Thanks for your reply. I cannot use ProcessBuilder because the program
> uses Java 1.4.
> The environment is as follows:
> Java: 1.4.x
> AIX 5.3
My advice still applies, you need to "drain" the stdout and stderr buffer.
It is unfortunate that you are on such an antiquated set up. Java 1.4
was surpassed by Java 1.5 on September 30, 2004, nearly 7 years ago.
Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Next in thread | Find similar
Java Runtime getRuntime().exec not work in AIX SamuelXiao <foolsmart2005@gmail.com> - 2011-09-22 08:09 -0700
Re: Java Runtime getRuntime().exec not work in AIX Daniel Pitts <newsgroup.nospam@virtualinfinity.net> - 2011-09-22 14:56 -0700
Re: Java Runtime getRuntime().exec not work in AIX SamuelXiao <foolsmart2005@gmail.com> - 2011-09-23 07:31 -0700
Re: Java Runtime getRuntime().exec not work in AIX Daniel Pitts <newsgroup.nospam@virtualinfinity.net> - 2011-09-23 10:20 -0700
Re: Java Runtime getRuntime().exec not work in AIX Arne Vajhøj <arne@vajhoej.dk> - 2011-09-22 21:20 -0400
Re: Java Runtime getRuntime().exec not work in AIX SamuelXiao <foolsmart2005@gmail.com> - 2011-09-23 07:35 -0700
Re: Java Runtime getRuntime().exec not work in AIX Patricia Shanahan <pats@acm.org> - 2011-09-23 09:45 -0700
Re: Java Runtime getRuntime().exec not work in AIX Arne Vajhøj <arne@vajhoej.dk> - 2011-09-23 17:45 -0400
Re: Java Runtime getRuntime().exec not work in AIX Andreas Leitgeb <avl@gamma.logic.tuwien.ac.at> - 2011-09-24 00:14 +0000
Re: Java Runtime getRuntime().exec not work in AIX Arne Vajhøj <arne@vajhoej.dk> - 2011-09-23 20:41 -0400
Re: Java Runtime getRuntime().exec not work in AIX SamuelXiao <foolsmart2005@gmail.com> - 2011-09-26 08:28 -0700
Re: Java Runtime getRuntime().exec not work in AIX Andreas Leitgeb <avl@gamma.logic.tuwien.ac.at> - 2011-09-26 22:33 +0000
Re: Java Runtime getRuntime().exec not work in AIX Lars Enderin <lars.enderin@telia.com> - 2011-09-24 10:59 +0200
Re: Java Runtime getRuntime().exec not work in AIX Roedy Green <see_website@mindprod.com.invalid> - 2011-09-26 02:27 -0700
Re: Java Runtime getRuntime().exec not work in AIX Andreas Leitgeb <avl@gamma.logic.tuwien.ac.at> - 2011-09-26 09:32 +0000
Re: Java Runtime getRuntime().exec not work in AIX Lars Enderin <lars.enderin@telia.com> - 2011-09-26 19:42 +0200
Re: Java Runtime getRuntime().exec not work in AIX Arne Vajhøj <arne@vajhoej.dk> - 2011-09-26 19:31 -0400
Re: Java Runtime getRuntime().exec not work in AIX Roedy Green <see_website@mindprod.com.invalid> - 2011-09-24 16:29 -0700
csiph-web