This week's book giveaway is in the Agile and Other Processes forum.
We're giving away four copies of The Little Book of Impediments (e-book only) and have Tom Perry on-line!
See this thread for details.
Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Help with creating JAR

 
Anamika Majumder
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Everyone,
I am very new to this subject, and have a question which might sound very silly to many of you, but thought would ask for help anyway.
I am on page 40 of the Head First EJB Book, and am trying to add the headfirst directory with the .class files to the EJB Jar. But when I select the headfirst directory and click 'Add', only the .class files get added in the Contents text area (at the same level as the META-INF directory) and the headfirst directory doesn't get added.
I discovered that I am able to add the headfirst directory under src, which when added to Contents, contains the .java files. (I know that the .java files are not required, but I was just experimenting). Hence, as a workaround, I copied the .class files from under src/headfirst to classes/headfirst with the hope that now when I select src/headfirst the .class files will be added and I would just remove the .java files.
However, to my surprise, the .java files did get added at the correct level, but the .class files are again getting at the same level as the headfirst and the META-INF directories. This is how the tree structure looks no matter which way I go about adding the files.
+ META-INF
Advice.class
AdviceBean.class
AdviceHome.class
and not
+ META-INF
- headfirst
Advice.class
AdviceBean.class
AdviceHome.class
Can someone suggest where I might be going wrong?
Thank you.
Anamika
 
Brian Smith
Ranch Hand
Posts: 232
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Anamika,
This is strange! If you have defined a package in your source code like "package headfirst" and compiled successfully, obviously you have, then there should be no problem at all. I have worked with this examples a couple of times and i didn't have any problem at all. I suggest you should check your package statement again and try recompiling them again and see if it works.
Good luck!!
 
Vladas Razas
Ranch Hand
Posts: 385
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why do you try to add those .java files? Just put all .class files under your class/headfirst and add this directory in deploytool. If you set up your directories as it was said in book and used correct parameter to javac those .class files would be automatically compiled into that directory.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic