• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Trouble compiling servlet HFSJ pg 85

 
Ken Teoh
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys,

I'm having trouble compiling Servlet version 2 of HFSJ on page 85. Apparently,it's having trouble importing the com.example.model.* package.Therefore, the BeerExpert class can't be found. I followed exactly what the book said to do. Can anyone help?

Errors are below

package com.example.model does not exist
import com.example.model.*;
^
src/com/example/web/BeerSelect.java:22: cannot find symbol
symbol : class BeerExpert
location: class com.example.web.BeerSelect
BeerExpert be = new BeerExpert();
^
src/com/example/web/BeerSelect.java:22: cannot find symbol
symbol : class BeerExpert
location: class com.example.web.BeerSelect
BeerExpert be = new BeerExpert();
^
3 errors
 
Carolina Maia
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ken,

I got the same problem...
Try to change the ":" by ";" when compile.

javac - classpath /Users/bert.... servlet-api.jar; <----- here
classes; <--- and here
 
Ken Teoh
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey Caroline,

Thanks alot. I managed to make it work.
Can you explain why using ";" works?

Thanks
 
Ulf Dittmer
Rancher
Posts: 42969
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Unix uses colons to separate path entries; Windows uses semicolons. Why didn't Windows adopt the Unix notation? It has its roots in DOS, which emulates parts of CP/M, and CP/M does it this way (that's a guess, but probably a correct one). And, of course, the colon is used to separate the drive letter from the path on that drive.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic