title: Java URL hangs and never reads in Website
body: <p>I am trying to read in a website and save it to a string.  I'm using this code below which works perfectly fine in Eclipse.  But when I try to run the program via the command line in Windows like "java MyProgram", the program starts and just hangs and never reads in the URL.  Anyone know why this would be happening?</p>
  
  <pre><code>URL link = new URL("http://www.yahoo.com");
  
              BufferedReader in = new BufferedReader(new InputStreamReader(link.openStream()));
              //InputStream in = link.openStream();
              String inputLine = "";
              int count = 0;
              while ((inputLine = in.readLine()) != null)
              {
                  site = site + "\n" + inputLine;
              }
              in.close();
  </code></pre>
  
  <p>...</p>