Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

implementation and interfaces in seperate jar files

 
Abdul Basit Munda
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ,
I have a question regarding packaging and loading classes from seperate jar files. I have some interface classes in one package ( jar file) and implementation classes in other jar file. Now the problem is the package ( jar ) file containing interfaces has to call implementation class which is in seperate jar . Only thing i suppose to know is the implemented class name and nothing else. I am not sure , how will i be able to do that .

Any Help will be greatly appreciated
Thanks a lot
 
Seb Mathe
Ranch Hand
Posts: 225
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you have access to the implementation at compile time : no problem.
(Your jars must only be in your classpath.)

Otherwise, one way to do this is :



Thre's a lot of examples in Java : JDBC Drivers (interface is part of Java API, implementations are DB Vendors API...), a lot of J2EE things (servlets, JMS, etc.)
 
tito bayuadji
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
AFAIK as long in the same class path, I think it doesn't matter.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic