How to allow running only one instance of a Java program at a time?

前端 未结 9 2227
南旧
南旧 2020-11-30 00:07

I need to prevent users from starting my Java application (WebStart Swing app) multiple times. So if the application is already running it shouldn\'t be possible to start it

9条回答
  •  孤城傲影
    2020-11-30 00:44

    You could use the registry, although this halfheartedly defeats the purpose of using a high-level language like java. At least your target platform is windows =D

提交回复
热议问题