So, I try to export file variable:
String somePath = "/Users/me/File with whitespaces.json";
Runtime runtime = Runtime.getRuntime();
runtime.exec(String.format("$MY_FILEPATH=\"%s\"", somePath));
And I get some exception on this line:
java.io.IOException: Cannot run program "$MY_FILEPATH=/Users/me/File": error=2, No such file or directory
P.S. If I try "prepend space in file name with \", I get:
String somePath = "/Users/me/File\ with\ whitespaces.json";
Runtime runtime = Runtime.getRuntime();
runtime.exec(String.format("open %s", somePath));
And I also get some exception on this line:
The files /Users/me/File\, with\, whitespaces.json do not exist.
P.P.S If I wrap path in "", I also get exception like above