maven apache wrote:

> Hi, thanks for your detailed reply.
> And I have write a java class according to your instruction,however it can
> not give the right output.

What output does it give?

> I test with the spearfish60 data and the
> r.infoprocess.
> Attach my code, can you check it ?

>       public String run(String cmd)    {

>               try {
>                       cmd="/bin/sh -c " + cmd;
>                       String[] exe={"/bin/sh -c",cmd};

>                       Process p1=rt.exec(exe,env);

I suggest that you don't use the shell; it just makes life harder.
Instead, define:

        public String run(String[] cmd)  {
        ...
                        Process p1=rt.exec(cmd, env);

and use:

        gm.run({"r.info", "map=roads"});

-- 
Glynn Clements <[email protected]>
_______________________________________________
grass-user mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/grass-user

Reply via email to