This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Five Lines of Code and have Christian Clausen on-line!
See this thread for details.
Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring 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

HF EJB compile error

 
Ranch Hand
Posts: 79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi - I'm doing the Head First EJB book and am getting the following error when I go to compile from the command line like it wants:


C:\My_Programs\EJBClass\Advice\src\headfirst>javac advice.java
advice.java:4: package javax.ejb does not exist
import javax.ejb.*;
^
advice.java:11: cannot find symbol
symbol: class EJBObject
public interface Advice extends EJBObject

It does build in the Netbeans IDE - however the book would prefer that I not use the IDE so that I learn the nuts and bolts of everything 1st.

So - what's wrong in my setup?


^
 
Rancher
Posts: 43016
76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You're missing the EJB classes in your classpath. You need to do something like "javac -classpath XYZ.jar advice.java", where XYZ.jar is the file that contains the EJB classes. Check your EJB container, it should include it.
 
Karina Guenther
Ranch Hand
Posts: 79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is this what you were talking about? If so - it still doesn't work.

C:\My_Programs\EJBClass\Advice\src>javac -d ../classes headfirst/*.java

So, Where do the EJB classes exist? I've been looking for them and my path is

C:\My_Programs\EJBClass\Advice>path
PATH=C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\Common Files\Adaptec Shared\System;C:\Sun\AppServer\bin;C:\Program Files\Java\jdk1.5.0_06\bin

Did I miss downloading something?
I have JAVA_HOME set to...C:\Program Files\Java\jdk1.5.0_06
and J2EE_HOME set to... C:\Sun\AppServer

Could I be running into a version conflict?
 
Ulf Dittmer
Rancher
Posts: 43016
76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The "-d" switch merely tells the compiler where to put the class files, it has nothing to do with the "-classpath" switch that telli si where to look for additional classes.

Look through the jar files in the C:\Sun\AppServer directory - somewhere in there you should find the required jar file.

Also, you could download the class files from this page.
[ January 04, 2007: Message edited by: Ulf Dittmer ]
 
    Bookmark Topic Watch Topic
  • New Topic