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 for HFSJ - CH 3 Page 84

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

I am doing the first web application given in the book.(HFSJ - page 84)

I am now trying to compile 'BeerExpert.java' file but i get error:
----------------------------------------------------------------------
C:\Program Files\Apache Software Foundation\Tomcat 5.5\Myprojects\beerV1>javac -
d classes src/com/example/model/BeerExpert.java
Note: src/com/example/model/BeerExpert.java uses unchecked or unsafe operations.

Note: Recompile with -Xlint:unchecked for details.
----------------------------------------------------------------------

But at the same time i see a correspoding class file generated for 'BeerExpert' and placed in floder 'Classes/com/example/model'.

nOW if i try compiling 'BeerSelect.java' file i get error:
----------------------------------------------------------------------
C:\Program Files\Apache Software Foundation\Tomcat 5.5\Myprojects\beerV1>javac -
d classes src/com/example/web/BeerSelect.java
src/com/example/web/BeerSelect.java:3: package com.example.model does not exist
import com.example.model.*;
^
src/com/example/web/BeerSelect.java:18: cannot find symbol
symbol : class BeerExpert
location: class com.example.web.BeerSelect
BeerExpert bx = new BeerExpert();
^
src/com/example/web/BeerSelect.java:18: cannot find symbol
symbol : class BeerExpert
location: class com.example.web.BeerSelect
BeerExpert bx = new BeerExpert();
^
3 errors
----------------------------------------------------------------------


Please help, thanks.
 
Chaitanya Varanasi
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi...
I hope that you have found out the answer you have posted here... Anyways... if I am not 2 Late... The probable answer would be:

Actually the Current Directory might not be in the Classpath..If thats the case then please do add .; infront of the Classpath...whereever you have set those Enviornment Variables(My Computer-> Advanced tab->Enviornment Variables)

I hope this helps...
 
Cai DongShan
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi anand,

Have you solved your problem? The problem is your classpath setting. classes is missing. My setting (under Windows XP) is as follow. You can also put the classpath setting in the command line.

java_home
C:\Program Files\Java\jdk1.5.0_04\

Tomcat_home
C:\Program Files\Apache Software Foundation\Tomcat 5.5\

classpath
.;classes;%java_home%jre\lib\rt.jar;%Tomcat_home%common\lib\servlet-api.jar
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic