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

Error while compiling

 
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I am getting the following error while running the client code.
-------------------------------- Start -----------------------------
F:\Java\ejb\HF_EJB\projects\advice>javac -classpath {$CLASSPATH}:AdviceAppClient.jar AdviceClient.java
AdviceClient.java:14: package headfirst does not exist
import headfirst.*;
^
AdviceClient.java:17: package javax.ejb does not exist
import javax.ejb.*;
^
AdviceClient.java:34: cannot resolve symbol
symbol : class AdviceHome
location: class AdviceClient
AdviceHome home = (AdviceHome)PortableRemoteObject.narrow(o,AdviceHome.class);
^
AdviceClient.java:34: cannot resolve symbol
symbol : class AdviceHome
location: class AdviceClient
AdviceHome home = (AdviceHome)PortableRemoteObject.narrow(o,AdviceHome.class);
^
AdviceClient.java:34: cannot resolve symbol
symbol : class AdviceHome
location: class AdviceClient
AdviceHome home = (AdviceHome)PortableRemoteObject.narrow(o,AdviceHome.class);
^
AdviceClient.java:35: cannot resolve symbol
symbol : class Advice
location: class AdviceClient
Advice advisor = home.create();
^
6 errors
------------------------------- End --------------------------------

I have the projects\advice\classes\headfirst directory structure.
and my AdviceAppClient.jar in the projects\advice directory.

I am not sure why it is not able to locate my headfirst package.
Please help me.

Regards
Johnson
 
Ranch Hand
Posts: 1258
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm not going to bother giving you all the specific information, but basically you aren't setting up your classpath correctly to include those JARs that container all the necessary things. Also, make sure your j2ee.jar is included in your classpath.

You may want to search the forum for past posts on this topic, which seem to come up on average once every 12 minutes.
 
They weren't very bright, but they were very, very big. Ad contrast:
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
    Bookmark Topic Watch Topic
  • New Topic