code: private static String getFromEnvFile(String varname, String filename)
  	{
  		try
  		{
  			String	code = readFile(filename);
          	StringTokenizer stk = new StringTokenizer(code, "\n");
  	        while (stk.hasMoreTokens())
          	{
              	String line = stk.nextToken().trim();
  				if (line.startsWith("#")==false)
  				{
  					int	pos = line.indexOf(varname+"=");
  					if (pos>=0)	//	Var found
  						return line.substring(pos+varname.length()+1);
  				}
  			}
  		}
  		catch(Exception e) {
  			//System.err.println(e);
  		}
  		return null;
  	}
docs: ===============================================================