Win a copy of Mastering Corda: Blockchain for Java Developers this week in the Cloud/Virtualization 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
  • Paul Clapham
  • Ron McLeod
  • Bear Bibeault
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Jj Roberts
  • Carey Brown
Bartenders:
  • salvin francis
  • Frits Walraven
  • Piet Souris

Help with creating JAR

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 232
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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!!
 
Ranch Hand
Posts: 385
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Space pants. Tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic