Search code examples
javaiotemp

Different Results on Different System


When I use this code at my home PC, it gives the output as "output1" ,But when i use the same code at my office PC gives a different output as "output2".

code:

System.out.println(System.getProperty("java.io.tmpdir"));
  • Output 1: C:\Users\admin\AppData\Local\Temp\

  • Output 2: C:\Users\admin\AppData\Local\Temp

    Why there is a difference in output?


Solution

  • These outputs which the java gives from executing System.out.println(System.getProperty("java.io.tmpdir"));
    is taken from the TMP environment variable set in the system...

    Check there...

    There will be a difference in the path for environment variable set there.