如何部署Java应用程序,如果它被某人使用

huangapple go评论80阅读模式
英文:

How to deploy a java application if it is used by someone

问题

我编写了一个Java应用程序,许多我们组织内的人在使用。我经常需要对应用程序进行更改,因此我部署新的.jar文件,覆盖现有文件,而其他人可能会将其保持打开状态(我不知道为什么Windows允许我这样做,而在重命名或删除jar文件时却不允许...)。这会在应用程序中创建异常,如果有人尝试在其他人打开它的同时关闭并重新打开它,应用程序根本无法启动。

我知道最干净的解决方案是在部署新版本之前关闭所有实例的应用程序,但由于该应用程序由许多人(甚至是我们组织外的客户)运行,这几乎是不可能的。

我能做些什么?是否有任何其他有效的解决方案?

英文:

I have written a java application, which is used by many people in our organization. I often have to make changes to the application, so i deploy the new .jar file overwriting the existing one, while other people may have it open (i don't know why windows is permitting me this, when it doesn't permit me to rename or delete the jar...). This creates anomalies in the application, and if someone tries to close and reopen it while someone else has it open, the application doesn't start at all.

I know that the most clean solution would be to close all the instances of my appilcation before deploying the new version, but this is near impossible since the application is run by many people (even by customers outside our organization).

What could i do? Is there any other valid solution?

答案1

得分: 3

一种方法是使用 .bat 文件(假设你在 Windows 上运行),并让该文件指向最新版本的应用程序。

当你需要传递新版本时,你创建一个新目录,将更新后的应用程序复制到其中,然后修改 .bat 文件。

另一种方法是使用 Getdown

英文:

One way is to use a .bat file (assuming you're running on Windows) and let that file point to the most recent version of the application.

When you need to deliver a new version you create a new directory, copy the updated application into it, and then you modify the .bat file.

Another way is to use Getdown

huangapple
  • 本文由 发表于 2020年9月17日 15:50:37
  • 转载请务必保留本文链接:https://go.coder-hub.com/63933530.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定