Library for restarting your JVM application. You will most likely use it for restarting your GUI application programmatically.
It works no matter how your application is running:
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
<dependency>
<groupId>com.github.Dansoftowner</groupId>
<artifactId>Restart4j</artifactId>
<version>1.4.7</version>
</dependency>
repositories {
...
maven { url 'https://jitpack.io' }
}
dependencies {
implementation 'com.github.Dansoftowner:Restart4j:1.4.7'
}
final ApplicationRestart appRestart = ApplicationRestart.builder().build();
appRestart.restartApp();
final ApplicationRestart appRestart = ApplicationRestart.builder()
.beforeNewProcessCreated(() -> System.out.println("New process will be created..."))
.beforeCurrentProcessTerminated(() -> System.out.println("The app will be terminated"))
.build();
appRestart.restartApp();
Two demo applications can be found in the project:
Restart4j
If this library is used by your project, let me know in the Discussions
and I will mention that in this section.