2 Replies Latest reply: Nov 19, 2013 10:20 PM by rp0428 RSS

    Detect internet Connection using Java

    rakeshvrm5

      i googled      How Detect internet Connection using Java?

       

      and found this code

       

      try {

                  Process p1 = java.lang.Runtime.getRuntime().exec("ping www.google.com");

                  System.out.println(p1.waitFor());

      // return 0(zero) if internet is availble

              }

      catch (Exception e)

      {

      // caught exception

              }

       

      It is working fine in windows.

       

       

      How change above code so that it works for mac??

       

      Thnax in advance