problem with runtime and exec - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

problem with runtime and exec

vics0vics0 Posts: 2Member
I want use 'wget' command from my Java application
for 'wget' i created command as String type.
Here is it

[code]String url_str=wget --post-data "year=2009&month=08&day=01&time=0&profile=1&start=0&stop=1000&step=50&par=&format=0&vars=01&vars=02" -O /home/user/test_wget.txt

then i use it in exec method


Runtime rt = Runtime.getRuntime();
Process p = rt.exec(url_str);
BufferedReader r = new BufferedReader(
new InputStreamReader(p.getErrorStream()));
String s;
while ((s = r.readLine())!=null) {
System.out.println( s );
catch (IOException e){
// TODO Auto-generated catch block

catch ( InterruptedException e ) {

after running the file test_wget.txt hold
[code]Model Error
Wrong key: not alpha/numerical characters[/code]

however, if i use my url_str from Linux command line
test_wget.txt is hold usefull data.

So, how working correct with wget from Java application?

Thanks for any replys
Sign In or Register to comment.