Hello. You need to create a configuration file with the extension ini. I set this file with such code:

File file = new File(System.getProperty("user.dir")+"/"+UID+".ini"); 

Where UID is a specific code transmitted by the client. The result is approximately the following:

 C:\Users\тутимяпользователя\workspace\Encryptcserver\345161тутимяпользователяKHtGuI .ini 

It turns out that the address is on one line, and the extension is already on another. As a result, the compiler swears and gives this:

java.io.IOException: Syntax error in file name, folder name, or volume label

Tell me the solution, please.

    2 answers 2

    Well ... Maybe you have a line break (/ n) at the end of the UID?

    • Not. The most interesting thing is that everything works fine on Unix systems. As I understand it, the address is too long. When only 1 directory, for example, C: / UID /, then everything works. Apparently, the address is too long. - TheCoolKuid
    • one
      @TheCoolKuid on Unix systems is a slightly different newline character. Check your UID again, perhaps, @YuriSPb is right. - a_gura

    I had the same error. This is due to the fact that the name of the file / folder contains prohibited characters. For example, the colon cannot be, the name of the COM1 file also cannot be, etc. Try first in this folder to create a file with the name that the program wants, and you will see which character is forbidden.