Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

FBN: jar file to submit - Need help

 
Ranch Hand
Posts: 79
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • 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
  • 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
  • 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
  • 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
  • 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
  • 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
  • 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.
 
Popeye has his spinach. I have this tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic