Knowing the Temp Location in Your Environment

You may want to know the temp location in your environment to use it for some purpose during the execution of the program. Here is the code to help.

public class KnowTempLocation{   public static void main(String args[])   {      KnowTempLocation knowTempLocation = new KnowTempLocation();      knowTempLocation.proceed();   }      private void proceed()   {      System.out.println("Your TEMP location is " + System.getenv("TEMP"));   }}/*Expected output:[[email protected]]# java KnowTempLocationYour TEMP location is /var/tmp/*/
Share the Post:
Share on facebook
Share on twitter
Share on linkedin

Overview

Recent Articles: