jvm

stardiviner 2018-02-13T15:22:50.000458Z

I want to change Clojure current working directory. But after a search, found not possible except one try: https://stackoverflow.com/questions/840190/changing-the-current-working-directory-in-java#840229

stardiviner 2018-02-13T15:23:15.000026Z

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

stardiviner 2018-02-13T15:23:55.000295Z

Because I do Emacs Org-mode Babel literate programming like this: https://github.com/stardiviner/ob-clojure-literate

stardiviner 2018-02-13T15:24:50.000424Z

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.

stardiviner 2018-02-13T15:25:16.000242Z

I found newprops.put("user.dir", "/etc"); in https://bugs.java.com/bugdatabase/view_bug.do?bug_id=4045688 But don't know how to call it in Clojure

alexmiller 2018-02-13T15:44:03.000079Z

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.