aspose file tools*
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes help for HFSJ - CH 3 Page 84 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "help for HFSJ - CH 3 Page 84" Watch "help for HFSJ - CH 3 Page 84" New topic
Author

help for HFSJ - CH 3 Page 84

jimmy
Greenhorn

Joined: Sep 01, 2004
Posts: 17
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

Joined: Dec 09, 2004
Posts: 26
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

Joined: Dec 07, 2004
Posts: 102
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


Best Regards,<br />DongShan<br /> <br />SCJP1.4, SCWCD1.4
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: help for HFSJ - CH 3 Page 84
 
Similar Threads
problem while compiling
unable to compile ,, says Recompile with -Xlint
Problem in compiling this code
HF Servlet and Java - MVC tutorial
help for HFSJ - CH 3 Page 84