I have written a code which uses RXTX Serial API for communication. Now I want to distribute a jar file for my program. The problem is that since I have used RXTX Serial API jar & dll files for this needs to be copied in java home. I wrote a code to copy this files in a correct location. Now after running the copy code if I rum my main program code it runs fine. But if I don't run my copy code first the other main program doesn't run. Fair and square. Now Since I have to distribute my code single jar file I can't ask user to run two different programs. I have to do it with one jar only. So I wrote a third program which calls my first code methods to copy the file and then my main code methods. This program is able to copy the files correctly but when it tries to run my Main program it fails saying that Serial API files are missing. And if I again try to run my program it runs perfectly. That proves the code checks for the resources before running only and any resource added during runtime doesn't count. So what I was thinking is it possible to run two java programs from one jar file one after the another like we can do with batch files?