• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

FBN: jar file to submit - Need help

 
Ranch Hand
Posts: 79
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,
As the different packages in the FBN assignment uses "import suncertify.mypackage", how are we suppose to organize the jar files to submit ?
I mean, if my package suncertify.server, import the suncertify.db, and the package suncertify.client also import the db package, how do I create client.jar and server.jar ?
Do I have to include suncertify.db in both jar files ?
Thanks for your help.
 
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
raphael A B,
Please change your display name to comply with The JavaRanch Naming Policy.
Thank You
 
Ranch Hand
Posts: 560
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I had,
fbnServer.jar - Server only files
fbnClient.jar - Client only files
fbnCommon.jar - Used by client and server
fbnServerForClient.jar - _Stub classes and remote interfaces.
 
raphael Bereh
Ranch Hand
Posts: 79
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well Sai Prasad
I am trying to that but I get the following error about the "imported" packages : ClassNoDefFounError : ...
when I try to run the jar file using java -jar myjar_file.jar (where an entry point has been defined)
Can you help ?
Thanks
 
Sai Prasad
Ranch Hand
Posts: 560
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I guess the jar file doesn't contain one of the referenced classes.
 
raphael Bereh
Ranch Hand
Posts: 79
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
No It does not,
And my question is : Do I have to add all the imported packages in each of these jar or is a way around it ?
Regards,
 
Sai Prasad
Ranch Hand
Posts: 560
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Imported packages must be present in the CLASSPATH. There is no way around it.
 
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Three ways to fix your problem:
1) Add the extra jars to the classpath on the command line
2) Put the extra jars on your classpath using the environment variable
3) *RECOMMENDED* Put an entry in the manifest file of the main jars that references the extra jars
Matt
 
raphael Bereh
Ranch Hand
Posts: 79
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Matthew Comer and Sai Prasad ,
I have tried the following on command line :
Set CLASSPATH=My_extra_jar_file.jar
java -jar my_server.jar or
java -classpath My_extra_jar_file.jar -jar my_server.jar
but none of these worked. Still get ClassNoDefFoundError.
How do you add the referrence to the extra jar in the manifest ?
Thanks.
 
Politics n. Poly "many" + ticks "blood sucking insects". Tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic