How to create empty folder in java? [duplicate]
问题 This question already has answers here : Closed 8 years ago . Possible Duplicate: How to create a folder? I tried to use the File class to create an empty file in a directory like "C:/Temp/Emptyfile". However, when I do that, it shows me an error : "already made folder Temp". Otherwise, it won't create one for me. So, how do I literally create folders with java API? 回答1: Looks file you use the .mkdirs() method on a File object: http://www.roseindia.net/java/beginners/java-create-directory