Home » Java » How to update a java desktop application jar made with maven-Exceptionshub

How to update a java desktop application jar made with maven-Exceptionshub

Posted by: admin February 25, 2020 Leave a comment

Questions:

I have recently created a Java desktop application with the help of maven and it runs in Linux and Windows.

My problem is that this application in the future is going to have more functionality, so I want it to detect when it changes on the Github repository where the code is.

For this purpose I have found some “solutions”, but i don’t really know what is the best one for my case or if there is a better one. Here are some of the options I came across:

First

The command instruction: java uf jar -file input -file(s) in order to have the new files from the repository get them with the clone option of JGit. (I’m not quite sure if I can modify a jar in run time)

Second

Use an updater like install4J, UpdateFX or Java web start, but I don’t know really how to use them.

Third

I’m a little bit noob in terms of maven so I don’t really know if maven has something implemented to update automatically the dependences of a project when it is in an executable jar. If there is something like that I will be happy to hear it.

Fourth

Having the new version of the jar in the Github repository and if the application detects a new version downloads it and replace itself with the new one.

Fifth

Create another maven project for upgrading the project, having the project as a maven dependence in the new one.

Sixth

Use ClassLoader.

How to&Answers: