I'm developing an application that works with files (save and load) and I have to work with system variables to determine where to save those files.
My question is: Is there any way to use variables regardless of the operating system? If so, how should I proceed? For example, I know if I put a caminho
variable, for example in windows as follows:
%caminho%\algum_dir\algum_arquivo.exemplo
It will convert %caminho%
to the string contained in this variable. The same goes for Linux, only using $caminho
. So, in short, I wanted to know if it is possible to use some kind of naming for the program to detect an environment variable, which has a name defined by me, independent of the OS, since the program will be in Java.