0

所以我有一个 jar 文件,我想知道如何拥有它,以便当 PC 启动时,如果他们选择该选项,它会运行 jar。我不想将文件制作成 .exe 或使用任何第三方软件来执行此操作。我也想这是否适用于 Windows、Linux 和 Mac。我发现的大多数解决方案仅适用于 Windows 或使用其他软件来执行此操作。

4

1 回答 1

0

Well, you solution will be OS dependent. The main thing is that you have to say java -jar youjarfile.jar in some way. That assumes that a JVM is installed and is accessible to the OS and it can run. In case of Windows there are different methods (registry, Startup), in case of Linux you can place it into the user's startup scripts (distro and shell dependent) or init.d sequence if you go system wide.

于 2013-07-24T19:48:25.593 回答