JVM shut down ala Eclipse or Jbuilder

Discussion in 'Java' started by Sambucus, Nov 25, 2004.

  1. Sambucus

    Sambucus Guest

    Hi all,
    anyone who knows how to force a running jvm to shut down like Eclipse
    or Jbuilder does when you press their little stop button?

    I have this problem with some sockets refusing to shut down (I guess
    it is because they are blocking for input). When I run my app from
    eclipse and use a normal System.exit(); or
    Runtime.getRuntime().halt(0); the app refuses to shut down, however,
    if I press eclipses stop/shutdown button it imideatly shuts down the
    jmv and all sockets. I would like to know if there is some way to
    implement this from within my app?

    Any help much appritiated!

    /Andreas
     
    Sambucus, Nov 25, 2004
    #1
    1. Advertising

  2. Sambucus

    Ann Guest

    windows task manager

    "Sambucus" <> wrote in message
    news:...
    > Hi all,
    > anyone who knows how to force a running jvm to shut down like Eclipse
    > or Jbuilder does when you press their little stop button?
    >
    > I have this problem with some sockets refusing to shut down (I guess
    > it is because they are blocking for input). When I run my app from
    > eclipse and use a normal System.exit(); or
    > Runtime.getRuntime().halt(0); the app refuses to shut down, however,
    > if I press eclipses stop/shutdown button it imideatly shuts down the
    > jmv and all sockets. I would like to know if there is some way to
    > implement this from within my app?
    >
    > Any help much appritiated!
    >
    > /Andreas
     
    Ann, Nov 26, 2004
    #2
    1. Advertising

  3. Sambucus

    Sambucus Guest

    Ehh, yes of course, but that will not work for me I'm afraid.
    I dont know if eclipse/jbuilder uses a native call to end the jvm
    process? In that case it would be the same as using the task manager,
    but can you implement that into a Java app?

    "Ann" <> wrote in message news:<XqJpd.568123$mD.208134@attbi_s02>...
    > windows task manager
    >
    > "Sambucus" <> wrote in message
    > news:...
    > > Hi all,
    > > anyone who knows how to force a running jvm to shut down like Eclipse
    > > or Jbuilder does when you press their little stop button?
    > >
    > > I have this problem with some sockets refusing to shut down (I guess
    > > it is because they are blocking for input). When I run my app from
    > > eclipse and use a normal System.exit(); or
    > > Runtime.getRuntime().halt(0); the app refuses to shut down, however,
    > > if I press eclipses stop/shutdown button it imideatly shuts down the
    > > jmv and all sockets. I would like to know if there is some way to
    > > implement this from within my app?
    > >
    > > Any help much appritiated!
    > >
    > > /Andreas
     
    Sambucus, Nov 27, 2004
    #3
  4. Sambucus

    Ann Guest

    "Sambucus" <> wrote in message
    news:...
    > Ehh, yes of course, but that will not work for me I'm afraid.
    > I dont know if eclipse/jbuilder uses a native call to end the jvm
    > process? In that case it would be the same as using the task manager,
    > but can you implement that into a Java app?
    >
    > "Ann" <> wrote in message

    news:<XqJpd.568123$mD.208134@attbi_s02>...
    > > windows task manager
    > >
    > > "Sambucus" <> wrote in message
    > > news:...
    > > > Hi all,
    > > > anyone who knows how to force a running jvm to shut down like Eclipse
    > > > or Jbuilder does when you press their little stop button?
    > > >
    > > > I have this problem with some sockets refusing to shut down (I guess
    > > > it is because they are blocking for input). When I run my app from
    > > > eclipse and use a normal System.exit(); or
    > > > Runtime.getRuntime().halt(0); the app refuses to shut down, however,
    > > > if I press eclipses stop/shutdown button it imideatly shuts down the
    > > > jmv and all sockets. I would like to know if there is some way to
    > > > implement this from within my app?
    > > >
    > > > Any help much appritiated!
    > > >
    > > > /Andreas

    Use Runtime
    Taskkill
    Ends one or more tasks or processes. Processes can be killed by process ID
    or image name.
    Syntax
    taskkill [/s Computer] [/u Domain\User [/p Password]]] [/fi FilterName]
    [/pid ProcessID]|[/im ImageName] [/f][/t]
     
    Ann, Nov 27, 2004
    #4
  5. Sambucus

    John English Guest

    Sambucus wrote:

    > Ehh, yes of course, but that will not work for me I'm afraid.
    > I dont know if eclipse/jbuilder uses a native call to end the jvm
    > process? In that case it would be the same as using the task manager,
    > but can you implement that into a Java app?


    Try Runtime.exit() -- "terminates the currently running Java virtual
    machine by initiating its shutdown sequence".

    -----------------------------------------------------------------
    John English | mailto:
    Senior Lecturer | http://www.it.bton.ac.uk/staff/je
    School of Computing & MIS | ** NON-PROFIT CD FOR CS STUDENTS **
    University of Brighton | -- see http://burks.bton.ac.uk
    -----------------------------------------------------------------
     
    John English, Nov 30, 2004
    #5
  6. On Tue, 30 Nov 2004 12:14:29 +0000, John English wrote:

    > Sambucus wrote:
    >
    >> Ehh, yes of course, but that will not work for me I'm afraid.
    >> I dont know if eclipse/jbuilder uses a native call to end the jvm
    >> process? In that case it would be the same as using the task manager,
    >> but can you implement that into a Java app?

    >
    > Try Runtime.exit() -- "terminates the currently running Java virtual
    > machine by initiating its shutdown sequence".


    Which, according to the JavaDocs "The System.exit method is
    the conventional and convenient means of invoking this method"

    The OP mentioned earlier that invoking System.exit() was (amongst)
    the current way of doing things.

    [ Follow-Ups set to c.l.j.help. ]

    --
    Andrew Thompson
    http://www.PhySci.org/codes/ Web & IT Help
    http://www.PhySci.org/ Open-source software suite
    http://www.1point1C.org/ Science & Technology
    http://www.LensEscapes.com/ Images that escape the mundane
     
    Andrew Thompson, Nov 30, 2004
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Anders Both

    Shut down of asp.net process.

    Anders Both, Jan 11, 2004, in forum: ASP .Net
    Replies:
    5
    Views:
    648
    Hermit Dave
    Jan 13, 2004
  2. Soefara
    Replies:
    4
    Views:
    724
    John C. Bollinger
    Nov 18, 2003
  3. davout
    Replies:
    1
    Views:
    593
  4. Steve
    Replies:
    0
    Views:
    477
    Steve
    Jan 31, 2006
  5. Ramon F Herrera
    Replies:
    6
    Views:
    696
    Ramon F Herrera
    Nov 11, 2007
Loading...

Share This Page