Skip to content

A simple library to add Java/Kotlin.JVM apps to the autostart of Windows.

License

Notifications You must be signed in to change notification settings

vatbub/javaAutoStart

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

50 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

javaAutoStart Build Status Maven Central

A simple library to add Java/Kotlin.JVM apps to the autostart of Windows.

Download

The library is available on Maven Central and on JCenter.

<dependency>
    <groupId>com.github.vatbub</groupId>
    <artifactId>javaAutoStart</artifactId>
    <version>1.1</version>
</dependency>

Latest version: Maven Central

If you get some strange JNA exceptions, also add these dependencies:

<dependencies>
    ...
    <dependency>
        <groupId>net.java.dev.jna</groupId>
        <artifactId>jna</artifactId>
        <version>5.5.0</version>
    </dependency>
    <dependency>
        <groupId>net.java.dev.jna</groupId>
        <artifactId>jna-platform</artifactId>
        <version>5.5.0</version>
    </dependency>
    ...
</dependencies>

The latest versions of the above dependencies are: Maven Central Maven Central

Usage

Java

import com.github.vatbub.javaautostart.AutoStartManager;

public class JavaDemo {
    private String appId = "com.github.vatbub.demoApp";

    public void autoStartDemo(){
        AutoStartManager manager = new AutoStartManager(appId);

        boolean isInAutoStart = manager.isInAutoStart();

        if (!isInAutoStart)
            manager.addToAutoStart(/* optional: additional launch arguments */);

        manager.removeFromAutoStart();
    }
}

Kotlin

import com.github.vatbub.javaautostart.AutoStartManager

private val appId = "com.github.vatbub.demoApp"

fun autoStartDemo() {
    val manager = AutoStartManager(appId)
    
    val isInAutoStart = manager.isInAutoStart
    if (!isInAutoStart)
        manager.addToAutoStart(/* optional: additional launch arguments */)
    
    manager.removeFromAutoStart()
}

License

This library is licensed under the Apache License v2. Open the LICENSE.txt file of this repository for more info.

Contributing

Contributions are welcome. As always, you can submit an issue, fork and submit PRs.

About

A simple library to add Java/Kotlin.JVM apps to the autostart of Windows.

Resources

License

Stars

Watchers

Forks

Packages

No packages published