System.exit(0)   will not close the program

uh, for some reason when the conditions inside the processInputString are met, the program fails to shutdown. The msg to console is posted and program hangs when it should close.
public class JPing2 {
    public static void main(String[] args) {
        String ip = "74.125.67.100";    //google.com
        String pingCmd = "ping -t " + ip;
        try {
            Runtime r = Runtime.getRuntime();
            Process p = r.exec(pingCmd);
            BufferedReader br = new BufferedReader(new
            InputStreamReader(p.getInputStream()));
            String inputLine = new String();
            while ((inputLine = br.readLine()) != null) {
                System.out.println(inputLine);
                processInputString(inputLine);
            br.close();
        } catch (IOException ioe) {
            System.out.println(ioe.getMessage());
            System.exit(0);
     * Parses a string looking for ping failures
    static void processInputString(String input) {
        String failMsg = new String("Request timed out.");
        if (input.equals(failMsg)) {
            System.err.println("failure detected");
            System.exit(0);
        } else if (input.equals("Reply from 74.125.67.100: bytes=32 time=33ms TTL=51")) {
            System.err.println("normal operation");
            System.exit(0);
}what the hell, am I missing something?
Edited by: rico16135 on Aug 24, 2009 10:17 PM

Probably because it's blocked reading the process output and this might be an operation that can't be interrupted.

Similar Messages

  • Hello, what to do if a program crash? I was working in a power point presentation and suddenly the little rainbow circle appeared and can not close the program, thanks

    Hello, what to do if a program crash? I was working in a power point presentation and suddenly the little rainbow circle appeared and can not close the program, thanks

    Welcome to Apple Support Communities
    Press Alt, Command and Esc keys, select the crashed app and force quit it. Then, open this app again.
    If you didn't save this document, it's possible that you lost the changes you made unless you have OS X Lion or Mountain Lion and they saved your document automatically

  • There was an error importing some photos from my iphone, and since then I can not close the program ... it gives the mesage 'please wait until import is conclued'...but nothing is being tranfered. Any help ? Iphoto version 9.5.1

    there was an error importing some photos from my iphone, and since then I can not close the program ... it gives the mesage 'please wait until import is conclued'...but nothing is being tranfered. Any help ? Iphoto version 9.5.1

    Force Quit the application from the Apple menu.

  • Help  I have installed and reinstalled iTunes but it will not open.  I get an error telling me that windows DEP will not allow the program to run and i can not shut the DEP off for the program.  i need to reset my ipod touch and cant cause of this.

    I have tried to shut off the DEP for the program but it is not allowed.  I can't get to any of my music on my computer because of this.  I use windows vista and was able to use ITunes until the upgrade to 10.2.  now i can't even open the program and it is getting me very upset.  Please someone help me.

    Many thanks.
    That suggests that another application has stashed old QuickTime componentry in your system files.
    So just in case we'll go looking for older QuickTime componentry in the most common locations for it to be stashed.
    First we'll need to change some view settings.
    In your Start menu, open Computer.
    In your Organise menu, select Folder Options.
    In the View tab, make sure that "Show hidden files and folders" is selected, and Hide extensions for known file types is unchecked.
    Click OK.
    Now in Computer, open your C:\ drive (or whichever drive you have your operating system installed on).
    Open the "Windows" folder.
    If you have a 32-bit version of Windows, open the "System32" folder.
    If you have a 64-bit version of Windows, open the "SysWOW64" folder.
    What files and folders can you see in there with QuickTime in the title? (In a standard installation of Quicktime you should be seeing precisely two files... QuickTime.qts and QuickTimeVR.qtx ... and no QuickTime folders whatsoever.)

  • Captivate 7 Quiz Results - Will not close the quiz!

    Hi everyone, I'm having a REALLY hard time configuring Captivate 7 to auto close when the quiz is done at the end of a presentation.  The last slide in each of my presentations is the quiz results page, and no matte rhow I configure it, whether to exit with JavaScript, Exit, Close or continue to a new slide with an exit button, nothing will work.  Can someone please help with this?

    I'm glad to see others are having similar problems.  We have a problem with the Exit button on the playbar.  We have been using it for years in our CP6 courseware, with various LMSs (for clients), using a template, and it has worked.  Now, with CP7, it's not working with one of the LMSs.  The files created in CP6 still work, so it's not a change in the LMS.  We bought multiple copies of CP7 for our various developers, and now we can't use them.  Making an overall change, like removing the Exit button on the playbar and using another method, will mean that our courseware is not consistent from one application to another, which would not be a good solution.
    Any ideas?

  • "Delete and Close Gap" on Premier 13 will "delete" a photo but will not "close the gap".  How do I correct this?

    The area just goes dark in the finished product for the time that was there before and the gap remains. 

    joseh54506628
    What computer operating system is your Premiere Elements 13 running on?
    Many of these Delete and Close Gap failures can be traced to content that is directly above or below the area of interest.
    Depending on the circumstances, you may be forced to select the clip or clips in a group and do a manual close gap
    with the mouse.cursor.
    Please review the following as one instance of Delete and Close Gap Failure.
    http://atr935.blogspot.com/2014/02/pe-delete-and-close-gap-failures.html
    If possible could you represent you Delete and Close Gap situation with a screenshot?
    We will be watching for your progress.
    ATR

  • The latest firefox release - 6.0.2 will not allow the program Rocketdock to pop up (be active overlaying firerox). NO previous releases had this problem. I cannot figure out what is going on.

    Rocketdock functions like the windows task bar where it will hide until mouse over. The mouse over function seems to be the issue. Firefox somehow blocks recognition of the mouse for Rocketdock.
    All other programs and previous releases work just fine with the Rocketdock.

    Rocketdock functions like the windows task bar where it will hide until mouse over. The mouse over function seems to be the issue. Firefox somehow blocks recognition of the mouse for Rocketdock.
    All other programs and previous releases work just fine with the Rocketdock.

  • ITunes will not load - The program executes, but no GUI display

    Hey guys,
    I have iTunes 8.0.1 installed on a Windows XP Pro computer. It was a new installation of iTunes.
    After installing, I try to run iTunes, and all i see is the mouse changing to a timer for 2 seconds then reverting back to the pointer, but no application shows.
    I have tried reinstalling iTunes which does not work and I have both scanned my computer for viruses and spyware with F-secure and Spybot search and destroy respectively and have found nothing.
    Plugging in my iPod does not help.
    I have also tried using msconfig to disable all process and tried starting itunes and also disabling all but apple processes but also that does not work.
    I also tried to download the quicktime standalone to reinstall and that has not worked either.
    Can someone please give me some heads up as to how to proceed?
    Thank you very much,
    Jeff

    Can really nobody help me? I cant use my iPod without iTunes!

  • IPhoto 11 asks for a software update before starting but doesn`t find any updates and will not open the program?

    What can i do to solve my problem? I uninstalled the software and re installed but still inidcate to upgrade and don't find any update.

    Thank you very much for your help. The problem was solved follwing the next steps:
    1- Remove iphoto
    2- Install it again from the iLife11 disc.
    3- Download and install manually the update to iPhoto 9.1:
    http://support.apple.com/kb/DL1322
    4- Dowload and install manually the update to iPhoto 9.3:
    http://support.apple.com/kb/DL1545
    5- Depress the option and command keys and Launch iPhoto
    6- Rebuild library

  • Itunes will no longer work on my Windows 8 PC. When I attempt to start the program a message says: A problem caused the program to stop working correctly.  Windows will close the program and notify you if a solution is available.

    Itunes will no longer work on my Windows 8 PC. When I attempt to start the program a message says: A problem caused the program to stop working correctly.  Windows will close the program and notify you if a solution is available.  I have tried to uninstall iTunes but the Windows uninstaller will not delete the program I get a message that says: A network error occurred while attempting to read file: C:\Windows|Installer|iTunes.msi.  How do I get iTunes to work again?

    Whentrying to uninstall iTunes (the first program that must be uninstalled per the instructions) I get a message:  A network error occurred while attempting to read file: C:\Windows|Installer|iTunes.msi. I can't even uninstall iTunes?
    (1) Download the Windows Installer CleanUp utility installer file (msicuu2.exe) from the following Major Geeks page (use one of the links under the "DOWNLOAD LOCATIONS" thingy on the Major Geeks page).
    http://majorgeeks.com/download.php?det=4459
    Here's a screenshot showing the particular links on the page that you should be clicking:
    After clicking one of the circled links, you should be taken to another page, and after a few seconds you should see a download dialog appear for the msicuu2.exe file. Here's a screenshot of what it looks like for me in Firefox:
    Choose to Save the file. If the dialog box does not appear for you, click the link on the page that says "CLICK HERE IF IT DOES NOT". Here's a screenshot of the page with the relevant link circled:
    When the dialog appears, choose to save the file.
    (2) Go to the Downloads area for your Web browser. Doubleclick the msicuu2.exe file and follow the prompts to install the Windows Installer CleanUp utility. (If you're on a Windows Vista or Windows 7 system and you get a Code 800A0046 error message when doubleclicking the msicuu2.exe file, try instead right-clicking on the msicuu2.exe file and selecting "Run as administrator".)
    (3) In your Start menu click All Programs and then click Windows Install Clean Up. The Windows Installer CleanUp utility window appears, listing software that is currently installed on your computer.
    (4) In the list of programs that appears in CleanUp, select any iTunes entries and click "Remove", as per the following screenshot:
    (5) Quit out of CleanUp, restart the PC and try another iTunes install. Does it go through properly this time?

  • Mail will not close how do I close mail so I can shutdown my iMac?

    i just bought my first 27 inch imac a few weeks ago, I am a apple convert, today my mail will not close, the close mail tab is greyed out in to top task bar, and I tried to right click on the app and close that way but no go. is there yet a third way to shut down mail that I am not aware of as I can not turn off the imac until mail is closed, miss the force shutdown tab in pcs

    Use cheng5543's suggestion first. You can also Force Quit applications by clicking the Apple symbol in the upper left of the screen and choosing Force Quit and then choose the app to Force Quit.

  • Adobe 10.1.7 will not close in task manager after you exit the program. High cpu

    Hello,
    Updated to 10.1.7 and noticed that when you close the program an instance of acrobat stays open in task manager with high 50%+ cpu usage. Will not close at all unless you end task. if you open adobe again a new instance opens again consuming more cpu and cripples the machine with high cpu. This is on win 8 64bit machine. Had the previous release 10.1.6 working for some time on the same machine with no issues.
    Thank you in advance

    Identical issue with Acrobat XI Pro on Windows 8 Pro 64 bit. After viewing PDF file, upon closing Acrobat, a new Background Process starts called Adobe Acrobat (32 bit) uses 18% of cpu.  I have left run for three to four hours and does not close.  If I open another PDF file and then close, a second Background Process of Adobe Acrobat (32 bit) start, also using 18% of cpu.  I was able to open a third PDF file and upon closing a third Background Process of Adobe Acrobat (32 bit) start, also using 18% of cpu.  I did not try more.  All three consume over 50% of processor and after an hour does not close.  Fan and cpu begin to run hot so I manual End Task.  I tried Repair Acrobat Installation command, did not fix.  After searching forum used the Adobe Reader and Acrobat Cleaner Tool (http://labs.adobe.com/downloads/acrobatcleaner.html) to uninstall.  Then downloaded Acrobat XI Pro from My Adobe account login.  Reinstalled software.  Issue gone, could not replicate even after several hours of trying.  Then Checked for Updates. After updates installed, loaded and brought to version 11.0.3, problem returned as before. I have PDF files on both local drive and NAS, been able to recreate issue on both.  In a PDF intensive environment, I was having to leave the task manager up and occasionally stop Background Process of Adobe Acrobat (32 bit) so as to keep processor usage and fan speed down, thanks to Goateye01 for the suggestion, I now leave Acrobat open and close the files, this way the background process hang does not occur.  Additional Note, only able to create issue with standalone application, issue does not occur when in IE10 and viewing PDF files.   Hopefully a fix or helpful guidance coming soon?
    Vaio model SVS151290X
    Intel Core i7-3632QM [email protected]
    12 GB Ram
    256 GB SSD

  • The program will not close properly unless I turn off the computer.

    The program will not close properly. If I close it and then try to restart it I get a message saying that Firefox is already running.

    Even under normal circumstances it takes a few seconds after exiting Firefox before you can launch Firefox again successfully.
    But you're right, sometimes a zombie Firefox process lives on, consuming CPU cycles and memory long after all the user interface for it has disappeared. The zombie Firefox process blocks the launch of new ones. It's annoying, but there is a lighter-weight work-around than rebooting. If you key Del while holding down Ctrl and Alt (the old three-finger DOS reboot), either the Windows Task manager will pop up immediately or you can select it from a list of options. In the Windows Task Manager's Processes tab, you should be able to find "firefox.exe" in the Image Name column. (Left-clicking the Image Name column will sort the names alphabetically, and then you can scroll up or down looking for "f".) Left-click on that "firefox.exe" and then left-click the "End Process" box. A warning box should then pop up, asking if you're really sure you want to terminate the process. Answer Yes. Then wait a few seconds for disk activity to die down. Then re-launch Firefox as you would normally.

  • TS1717 Ever since I downloaded and installed iTunes64Setup.exe  v. 6.0.1, it crashes on my Windows 7 system, with the useless message, "iTunes has stopped working.  A problem caused the program to stop working correctly.  Windows will close the program an

    iTunes64Setup.exe, even after multiple times of uninstalling and reinstalling with even a fresh download crashes with the message:
    "iTunes has stopped working.  A problem [unspecified] caused the program to stop working correctly.  Windows will close the program and notify you IF a solution is available."  I cannot get out of this loop and it renders my iPad HD useless.  I tried calling the Apple Store but was referred by an automated system to this web site.  I tried looking up the problem in the FAQ but it didn't help.
    merylew

    Hi there Nok Saensanoh,
    I would recommend taking a look at the troubleshooting steps found in the article below.
    iTunes for Windows Vista, Windows 7, or Windows 8: Fix unexpected quits or launch issues
    http://support.apple.com/kb/ts1717
    -Griff W.

  • Mail won't display the viewer window, and it will not close (force quit does not show in menu bar).  Can't shut down to reboot because the open mail program prevents it.   Any advice?

    Mail does not show the viewer window even when new viewer window is cliced.  I tried to close mail and reopen, but it will not close, and force quit option does not appear in window bar.   I tried to shut down the computer and reboot, but it cannot close because of open mail program it says.    Help!

    Many thanks.  Once I was able to close mail, it reopened and behaved quite normally.  Thank you.  I'll remember the option quit for force quite!

Maybe you are looking for