Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

jar to jar communication

 
Deepa Raghuraman
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello friends,
i have a problem.
i have created two jar files and i want to use class of one jar file in another jar file
consider J1.jar and J2.jar are the two jar files
J1.jar file contains C1.class and C2.class
J2.jar file contains C3.class and C4.class
Now i want C3 object instantiated in C1
when i tried it gave me an exception :
"NoSuchClassDefError"
reply soon
Deepa Raghuraman
 
Rob Ross
Bartender
Posts: 2205
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As long as both jar files are in your classpath, the classes should be found.
Double-check your classpath settings. Make sure both jars are included - you have to actually include the name of each jar file. It's not sufficient to include the directory where the jar files are located.
 
Gerry Giese
Ranch Hand
Posts: 247
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Meesa no understand why you have problem wit jar jar!
Are you using the full package name? The objects reside in different namespace, so you have to use the full name or it won't work.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic