Re: Best Way For a Program to Restart Itself?

From: Amey Samant (ameyas7_at_yahoo.com)
Date: 06/28/04

  • Next message: Rune Johansen: "Re: Regex on whole (large) text file"
    Date: 27 Jun 2004 23:07:16 -0700
    
    

    hi Hal,
    im not an expert in java
    but if nothing works you can go native way
    in c,c++ u can call exec sys call which overloads the given program
    over itself without forking so ur parent wll now be ur newly updated
    java prog

    but in java i think exec will fork first n then load the program in
    child (which u dun wan here)

    rgrds
    amey

    Hal Vaughan <hal@thresholddigital.com> wrote in message news:<reSdnRL25OHZEUHdRVn-jg@comcast.com>...
    > My program can, when directed, check a floppy for updates, verify the MD5
    > sums from another source, then copy the new Java classes to its own
    > directory tree. Once it does this, I'd like to restart the program so the
    > changes take effect.
    >
    > What's the best way to do this?
    >
    > I figure if I call the program's main class, it will run, but then I'll have
    > 2 instances (the original and the one that's upgraded) running -- plus I'm
    > not sure if the new class I call will re-load the updated classes from
    > disk, since it's still run by the same JVM.
    >
    > I know I can call a program through Runtime, but can I call a program from
    > Runtime, as if from the command line, and exit the first program, and have
    > the 2nd continue running?
    >
    > Thanks!
    >
    > Hal


  • Next message: Rune Johansen: "Re: Regex on whole (large) text file"

    Relevant Pages

    • Re: [ANN] jfli - a Java FLI for LispWorks
      ... How do you plan to go about subclassing Java classes? ... Well, a nice library, such as SWT/Eclipse, often offers interfaces. ...
      (comp.lang.lisp)
    • Re: pack it up
      ... >> I have written a few Java classes that I would like to run on another ... >> Best regards to all Java Pros ... >> Jochen Opp ... a DOS window but the JAVA command line window? ...
      (comp.lang.java.help)
    • Re: [ANN] jfli - a Java FLI for LispWorks
      ... How do you plan to go about subclassing Java classes? ... I struggled with this problem in ABCL, and ended up writing a class generator, ... which produces classes whose methods call Lisp functions. ...
      (comp.lang.lisp)
    • Re: Importing java classes
      ... I need to call my own java class from within Matlab. ... where the last line is the directory of the VectorChooser class I copied ... way I can get matlab to read java classes is by starting matlab in the ...
      (comp.soft-sys.matlab)
    • Re: Load Java Class into Matlab
      ... > My Matlab is R14 SP1, installed on a WinXP Pro machine. ... > steps in the Matlab help menu, I still can not use my Java classes. ... > compiled class files are in directory C:\MyWork\Java\classes. ...
      (comp.soft-sys.matlab)