Home » Tip Bank » Java
  • Email Article
  • Comment on this Article
  • Share Article
    • Digg
    • del.icio.us
    • Newvine
    • furl
    • StumbleUpon
    • BlinkList
    • Newsvine
    • Magnolia
    • Facebook
    • Tailrank
    • Slashdot
    • Technorati
    • Google Bookmarks
    • Yahoo Favorites
    • Windows Live
    • Ask
Language: Java
Expertise: Intermediate
Feb 9, 2018

WEBINAR:

On-Demand

Full Text Search: The Key to Better Natural Language Queries for NoSQL in Node.js


Watch

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:

[root@mypc]# java KnowTempLocation
Your TEMP location is /var/tmp/

*/
M S Sridhar
 
Submit a Tip
Browse "Java" Tips
Browse All Tips
eloquentjavascript.net
html-color-codes.info