Hi Konstantin,

>From JDK docs (
http://java.sun.com/j2se/1.5.0/docs/api/java/lang/ProcessBuilder.html#environment%28%29
):

The behavior of the returned map is system-dependent. A system may not allow
> modifications to environment variables or may forbid certain variable names
> or values. For this reason, attempts to modify the map may fail with
> UnsupportedOperationException<http://java.sun.com/j2se/1.5.0/docs/api/java/lang/UnsupportedOperationException.html>or
> IllegalArgumentException<http://java.sun.com/j2se/1.5.0/docs/api/java/lang/IllegalArgumentException.html>if
>  the modification is not permitted by the operating system.
>

Regards,
Stuart

On 24 March 2010 02:43, Konstantin Barskiy <zuftw...@gmail.com> wrote:

> I'm trying to reproduce ProcessBuilder example from java documentation
> http://java.sun.com/javase/6/docs/api/java/lang/ProcessBuilder.html
> This is that example:
>
> ProcessBuilder pb = new ProcessBuilder("myCommand", "myArg1",
> "myArg2");
>  Map<String, String> env = pb.environment();
>  env.put("VAR1", "myValue");
>  env.remove("OTHERVAR");
>  env.put("VAR2", env.get("VAR1") + "suffix");
>  pb.directory(new File("myDir"));
>  Process p = pb.start();
>
> I'm typing folowing in clojure repl:
>
> D:\Users\Konstantin>java -jar clojure.jar
> Clojure 1.1.0
> user=> (def pb (new ProcessBuilder ["myCommand" "myArg"]))
> #'user/pb
> user=> (def env (.environment pb))
> #'user/env
> user=> (.put env "VAR1", "myValue")
> java.lang.IllegalArgumentException: Can't call public method of non-
> public class: public java.lang.String
> java.lang.ProcessEnvironment.put(java.lang.String,java.lang.String)
> (NO_SOURCE_FILE:0)
>
> What does this error mean and what i am doing wrong?
>
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with
> your first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com<clojure%2bunsubscr...@googlegroups.com>
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
>
> To unsubscribe from this group, send email to clojure+
> unsubscribegooglegroups.com or reply to this email with the words "REMOVE
> ME" as the subject.
>

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

To unsubscribe from this group, send email to 
clojure+unsubscribegooglegroups.com or reply to this email with the words 
"REMOVE ME" as the subject.

Reply via email to