Results 1 to 11 of 11
  1. #1
    jack_nutt is offline Member
    Join Date
    Jun 2011
    Posts
    8
    Rep Power
    0

    Default restarting the program

    Hey,

    in my program i am writing a log file, so when a certain condition occurs,


    if(value<=0)

    { restart the suimulation


    }

    so that i can run the simulation and log it many times automatically

    how can i put the restart logic,i am using eclipse

  2. #2
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    20

    Default Re: restarting the program

    Restart the simulation sens, what you really want to do? Start your application again or what? Please provide more details.

  3. #3
    jack_nutt is offline Member
    Join Date
    Jun 2011
    Posts
    8
    Rep Power
    0

    Default Re: restarting the program

    means the program starts running automatically from the start after resetiing everything

  4. #4
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    20

    Default Re: restarting the program

    Quote Originally Posted by jack_nutt View Post
    means the program starts running automatically from the start after resetiing everything

    From the application itself?

  5. #5
    CHLim is offline Member
    Join Date
    Nov 2011
    Posts
    24
    Rep Power
    0

    Default Re: restarting the program

    Well i'm not really sure what your asking about. I may be wrong but you can try a nested while loop.

    Java Code:
    while (condition) {
            variables here;
            while (value <= 0){ // if false goes back to the first while loop thereby restarting the simulation
            }
    }

  6. #6
    jack_nutt is offline Member
    Join Date
    Jun 2011
    Posts
    8
    Rep Power
    0

    Default Re: restarting the program

    as i am logging some results into a log file, i have to hit the Run button of eclipse to start my program if the "network dies" i need a command set that i can put in when the network is checked to be dead,it automatically starts teh process.

    my friend is doing it with

    try{

    Runtime.getRuntime().exec("java -jar /Users/xyz/Desktop/Test/file.jar");
    System.exit(0);
    }
    catch (Exception e){}

    }
    I cant get hold of my jar files
    how can i modify the code for me

  7. #7
    Junky's Avatar
    Junky is offline Grand Poobah
    Join Date
    Jan 2011
    Location
    Dystopia
    Posts
    3,788
    Rep Power
    7

    Default Re: restarting the program

    how to restart my program

    Duplicate post

  8. #8
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    20

  9. #9
    jack_nutt is offline Member
    Join Date
    Jun 2011
    Posts
    8
    Rep Power
    0

    Default Re: restarting the program

    My problem!!

  10. #10
    kkji is offline Member
    Join Date
    Aug 2011
    Posts
    54
    Rep Power
    0

    Default Re: restarting the program

    Jack, did you try the given link as that is similar to your post issue.

Similar Threads

  1. Restarting external program in Java app
    By danborgir in forum New To Java
    Replies: 0
    Last Post: 01-10-2011, 02:10 PM
  2. Restarting dead threads
    By DC200 in forum Threads and Synchronization
    Replies: 3
    Last Post: 12-03-2010, 10:09 PM
  3. Replies: 17
    Last Post: 07-25-2010, 07:20 PM
  4. How to rotate catalina.out without restarting tomcat
    By kzvi.kzvi.1 in forum Advanced Java
    Replies: 1
    Last Post: 03-25-2010, 06:05 PM
  5. Replies: 4
    Last Post: 06-05-2007, 01:45 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •