Fork me on GitHub

I want to change Clojure current working directory. But after a search, found not possible except one try:


I want to use it to change Incanter's generated plot image save path.


Because I do Emacs Org-mode Babel literate programming like this:


I tried (System/setProperty "user.dir" "/home/stardiviner"), and get this property (System/getProperty "user.dir"). The value did changed. But Incanter's save still save into the project root directory.


I found newprops.put("user.dir", "/etc"); in But don't know how to call it in Clojure

Alex Miller (Clojure team)15:02:03

I don’t think there is any way to change the current directory of the jvm process (for good reasons outlined in that ticket). Surely Incanter’s api allows you to specify where you wish to save images though and I would suggest changing that instead.