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:
- From Jar
- From an IDE
- From a unique packaged form
- etc...
- Java 8 or higher
- Works on the 3 major platforms: Windows, MacOS, Linux
<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:
If this library is used by your project, let me know in the Discussions
and I will mention that in this section.
- Document Archiver - Archive all your documents in a consistent way, which enables you to retrieve them later fast and easy.
- SLF4j - Simple Logging Facade for java
- OSHI - Operating System & Hardware information
- Jetbrains annotations - Annotations for JVM-based languages