Runtime.getRuntime.exec question

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • uni

    Runtime.getRuntime.exec question

    I have the following

    Process o = Runtime.getRunt ime.exec("java stuff",en);
    where en is -f CH-ResultsDB.. picked that up somewhere,
    anyways
    this code is run in a thread and i would like it to run every hour or so.
    The program that is called is a popupwindow which asks for some information
    from the user which then is send on to a server.
    But the problem is when i run the program by itself so not via the runtime
    command it works fine, but when i run it with a thread it sleeps before a
    user has time to fill out the form and therefore crashes, i dont get a error
    messgae but it doesnt seem to respond anymore...

    Any ideas?

    Erik


  • uni

    #2
    Re: Runtime.getRunt ime.exec question

    edit: The program doesnt crash however the window that is called up( the
    form) doesnt respond anymore after i try to send the information. The thread
    runs like normal
    And when i run the program alone it works fine.


    Comment

    • uni

      #3
      Re: Runtime.getRunt ime.exec question

      found out some more.... the program which is called crashes when i try
      establish the socketconnectio n. again when i run it by itself it works
      fine... is there a way so that i can have two extends at the end, the reason
      why i have two programs at the moment is becuase one is extends JFrame and
      the other extends Thread...
      Might it have to do with the fact that the thread is alredy asleep? if yes
      how might i prevent for the first program to continue until the called
      program is done?

      Erik


      Comment

      • Joseph

        #4
        Re: Runtime.getRunt ime.exec question

        not sure I understand all the details
        of your question (might help if you
        post some snippets of your code) but
        just in case your problem turns on
        this point I am wondering if you would
        want to try defining one class to
        extend JFrame and implement Runnable,
        rather than having two classes extending
        JFrame and Thread?

        "uni" <[email protected] d.ac.uk> wrote in message news:<c12ubh$li [email protected] .ac.uk>...[color=blue]
        > is there a way so that i can have two extends at the end, the reason
        > why i have two programs at the moment is becuase one is extends JFrame and
        > the other extends Thread...[/color]

        Comment

        • Jeff Rhines

          #5
          Re: Runtime.getRunt ime.exec question

          He could just use "extends JFrame implements Runnable", then pass the object
          to a "new Thread(Runnable )" (Sorry, original post is gone)

          Jeff

          "Joseph" <ILLicon@unchan ce.net> wrote in message
          news:64cec73a.0 402202139.53e6b [email protected] gle.com...[color=blue]
          > not sure I understand all the details
          > of your question (might help if you
          > post some snippets of your code) but
          > just in case your problem turns on
          > this point I am wondering if you would
          > want to try defining one class to
          > extend JFrame and implement Runnable,
          > rather than having two classes extending
          > JFrame and Thread?
          >
          > "uni" <[email protected] d.ac.uk> wrote in message[/color]
          news:<c12ubh$li [email protected] .ac.uk>...[color=blue][color=green]
          > > is there a way so that i can have two extends at the end, the reason
          > > why i have two programs at the moment is becuase one is extends JFrame[/color][/color]
          and[color=blue][color=green]
          > > the other extends Thread...[/color][/color]


          Comment

          Working...