Skip to content
Advertisement

Does Java IO have a maximum file name length limit?

Different operating systems have different file name max lengths. Does Java have any limit on file name length when working with files?

Advertisement

Answer

Java has no maximum file name length, except obviously for the String max length limit (which is the array max length, i.e. Integer.MAX_VALUE). Maybe some JVMs have a lower limit but I never run into such a problem (and I’m almost certain it would be a bug with respect to Java specifications), certainly OSes can have one.

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement