Code in clojure:
(import '(java.nio.file Files))
(Files/createTempDirectory "Test")
There is error:
CompilerException java.lang.IllegalArgumentException: No matching method: createTempDirectory, compiling:xxxx
But in java's doc http://docs.oracle.com/javase/7/docs/api/java/nio/file/Files.html#createTempDirectory(java.lang.String,%20java.nio.file.attribute.FileAttribute...)
There is an String parameter for createTempDirectory, I'm using java 1.7.0
Try this code:
(java.nio.file.Files/createTempDirectory "Test"
(into-array java.nio.file.attribute.FileAttribute []))
As @ymonad mentioned, you cannot omit the variable argument when calling java method with variable arguments. If you don't want to specify the FileAttribute, just pass the empty array of the type.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With