Each version will require a version.txt file or something similar which contains the version number.
The patcher downloads the current version.txt from the server and compares the version numbers.
If they are different (or the client-side version is corrupt (not a number) or missing) then it downloads the new game files.
To download the files from the internet, you use create a URL and use url.openStream() as the input stream, and the output stream is just a file.
Then, you need to use ProcessBuilder.
You set the directory to the folder that the game jar is in.
You set the application to “java”, the commands to “-jar Game.jar”
Then you execute the processbuilder (which launches the game) and exit the launcher.
(if you use the err/out streams then you may need to handle those from the launcher)