简体   繁体   中英

How to run a Java Web Start application on System Startup?

I've been searching for some possible cross-platform ways to run a Java Web Start application on system startup (or user login).

The user must launch by hand the JNLP file the first time. On this first run, the application checks the startup folder (at least on windows) and copies a batch file into it (autorun.bat or something like that).

On Windows, I can try to figure the Startup folder although I know that folder's path may vary from one to another Windows Version, or even the language....

On Linux and Mac, I have no idea how to do this.

My script for windows currently looks like this:

@ECHO off

REM Run Java Web Start using the Online JNLP File.
javaws "http://www.thewebsite.com/launcher.jnlp"

Once that script is in the Startup folder, it should run the Java Web Start application automatically when the user Logs into the OS, avoiding the need to ask the user to start that application manually every time.

I would like to know if anyone knows the best or recommended way to achieve the same goal for Windows, Linux and Mac, or a tool that helps with this. The less steps needed for the final user, the better.

Thanks.

For Linux Ubuntu(tested) and I believe other distros as well.

One option is to put a .desktop file in the user's home directory under ~/.config/startup.

The .desktop file is just a text file for your example it would be:

[Desktop Entry]  
Type=Application  
Exec=javaws "http://www.thewebsite.com/launcher.jnlp"

The full specification for .desktop files is here:
http://standards.freedesktop.org/desktop-entry-spec/desktop-entry-spec-1.0.html

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM