• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem with compiling the examples

 
Sean Hetfield
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
when I 'm trying to complie the examples, it gives me error because of javax.ejb.*; because It doesnot have access to packages. using j2sdk 1.4.2 how we can add access to those packages.
Thanks,
 
Vishwa Kumba
Ranch Hand
Posts: 1066
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The regular JDK does not have these APIs. You need to have the J2EE API classes, which are bundled with any Application Server supporting EJB.
You can also use Sun's RI.Make sure the J2EE jar classes are there in the classpath for your editor to compile your classes.
 
Sean Hetfield
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I,m having e difficulty running Sun RI, would you please tell me the other way (step by step) that I can compile these files. considering i have lib under j2sdkee1.3.1 in my CLASSPATH.
 
Kathy Sierra
Cowgirl and Author
Rancher
Posts: 1589
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Howdy --
When you say "examples", I'm not sure if you're referring to the examples in the HFEJB book. If you are, please let me know, but regardless-- if you give us more details about the problems that you're having, and we can probably give you more information to get you going.
cheers,
Kathy
 
Sean Hetfield
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi kathy,
Yes, I'm talking about Head First EJB book, Page 30 and I think there is a lack of information about how to complie these files, considering we have to have access to the packages for javax.ejb.* and at the same time having problem running RI with j2sdk 1.4.2 and j2sdkee1.3.1 and win XP (All the path are set).
The other question is that When will the Head First SCWCD comes out?
Thanks,
Sean
 
Ed Tse
Ranch Hand
Posts: 183
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The installation doc which can be found around where you download RI has explicitly said that you'll need to include j2ee.jar in your classpath which in the bin directory of where j2ee is installed.
 
Sean Hetfield
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have done that too, still doesn't work.
Thanks
Another SCJP
 
Ed Tse
Ranch Hand
Posts: 183
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
please show all the directory where JSDK and J2ee is installed in. Also list what's the command you are using to compile and where your project is located.
One more thing to note, in unix, you would use ':' to separate your items in your variable, where as in windows you would use ';'. Just in case you didn't know.
[ December 02, 2003: Message edited by: Edward Tse ]
 
Kathy Sierra
Cowgirl and Author
Rancher
Posts: 1589
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Howdy Sean,
Please give us more info!! I'm not sure what problems you're having, and whether it is with your R.I. configuration or with the structure you're using to compile the examples.
Can you give us a little more detail? A printout of the compiler error would be *really* helpful, as well as a printout of your environment variables and also, are you using the same directory structure described in the book?
Thanks! We'll get you going.
cheers,
Kathy

p.s. the SCWCD will come out approximately the same time the new exam is released... late March / early April. If you decide to take the beta exam, we'll have some drafts ready to help the beta testers.
 
Sean Hetfield
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
RI is located at D:\j2sdkee1.3.1
jsdk 1.4.2 is located at D:\Program Files\j2sdk_nb\j2sdk1.4.2
Enviroment Variables:
J2EE_HOME D:\j2sdkee1.3.1
JAVA_HOME D:\Program Files\j2sdk_nb\j2sdk1.4.2
PATH D:\Program Files\j2sdk_nb\j2sdk1.4.2\bin;D:\j2sdkee1.3.1\bin
CLASSPATH D:\j2sdkee1.3.1\lib
Location of files: D:\Java\Head First EJB Projects\projects\advice\src\headfirst
Then I open a command prompt and run this:
D:\Java\Head First EJB Projects\projects\advice\src>javac -d ../classes headfirst/*.java
Then I get 9 error.
headfist/Advice.java:3: package javax.ejb doesnot exist
import javax.ejb.*;
headfist/Advice.java:6: cannot resolve symbol
symbol : EJBObject
Location: interface headfirst.Advice
public interface advice extends EJBObject

and so on (the other 7 error are the same)
Thanks,
Sean
 
Keith Rosenfield
Ranch Hand
Posts: 277
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Sean,
Try this. Change your classpath to D:\j2sdkee1.3.1\lib\j2ee.jar.

Let me know if this does the trick.
Keith Rosenfield
SCJP
SCWCD
 
Sean Hetfield
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Keith,
Yes, It did work.
Thank you very much.
Sean
 
Keith Rosenfield
Ranch Hand
Posts: 277
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sean,
Glad it worked for ya.

Keith
 
Kathy Sierra
Cowgirl and Author
Rancher
Posts: 1589
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yay! Thanks Keith!!
Good luck Sean.
If I had a dime (US $ .10... ten cents) for everytime someone had a classpath issue, I wouldn't be a starving author.
cheers,
Kathy
 
Ed Tse
Ranch Hand
Posts: 183
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
YEAH!!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic