Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Modular java software using jars

 
Bill Lamboor
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Norm Radder
Ranch Hand
Posts: 732
4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Jesper de Jong
Java Cowboy
Saloon Keeper
Posts: 15214
36
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Put all the JARs in the classpath. It doesn't matter how you distribute your classes over the different JAR files, as long as they're all in the classpath.
 
Bill Lamboor
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm developing with JBuilder 8 and generating an executable .exe for windows os when packaging my app.
 
Bill Lamboor
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My apologies for the crosspot. I wasn't quite sure where to post this question. Im new on this site.

My no means was I trying to attract more attention.

Bill
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic