23

How do I restart the whole JVM in our Windows Server which have JRE, without restarting the OS?

Is there something like:

java -restart

Or this is not possible. The idea is that I added tool.jar in /lib/ext folder of the JRE and that I need to restart the JVM.

quarks
  • 33,478
  • 73
  • 290
  • 513
  • 6
    There is nothing like a JVM running in an OS. Instead several independent instances do run. Just make sure to stop all running Java applications (java*.exe) and restart them if necessary. – home Jan 17 '13 at 12:07
  • I think your issue like this http://stackoverflow.com/questions/259343/any-way-to-reboot-the-jvm – Kong Jan 17 '13 at 12:09
  • Just got into case when I run java profiler (Visual VM 1.3.8) and I see my Java app running having PID 3232. When I go to "Windows Task Manager"->"Services"->sort by PID there is no PID 3232. Then I go to processes and try to kill "Javaw" and it helped to remove that process 3232. – Vit Bernatik Apr 07 '15 at 17:52
  • https://dzone.com/articles/programmatically-restart-java – Koekiebox Aug 21 '17 at 10:41

1 Answers1

25

The Java process runs on demand as and when you want to run it. It's not a daemon. You need to stop the Java process manually (kill it) if it doesn't end gracefully.

Swapnil
  • 8,201
  • 4
  • 38
  • 57
  • 1
    As you start the JVM, it _should_ load that. You wouldn't need to worry about system libraries. You need to add your own jars (if any) to the classpath when you start the `Java` process. – Swapnil Jan 17 '13 at 12:39
  • Have a look at https://stackoverflow.com/questions/259343/any-way-to-reboot-the-jvm – Koekiebox Aug 21 '17 at 10:18