Im currently developing a software application in java. This applicaton contains many modules.
What I would like to do ulitmatly is at the end of my project have:
module1.jar module2.jar module3.jar
My question is can I somehow have these modules communicate with eachoter? Meaning have module1, 2 and 3 act as one jar but in physically split in three? can this be done?
The reason I wish to do this is to example send client updates of module2.jar withouht having to worry about module1.jar and module3.jar. I don't want to have to send an update of the entire project it is to large.
To have classes in one location use/reference classes in other locations requires that the classes be on the classpath. There are several ways to set the classpath. The Class-path: entry in the manifest of the jar file. The commandline when java is executed. Dynamically by using a ClassLoader in the program. An environment variable. (worst choice)
How do you execute your application? If its from a batch file or from a shortcut(Windows) then put all the jar files in the -classpath <files>;... option for the java.exe command. If its by opening a jar file, use the manifest file entry.