Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Can you help me get this file compiled?

 
Suresh Ramanan
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!

I am working with Head First Servlets and JSP.
I;m in the Mini MVC tutorial chapter.
When i compile the model CoffeeExpert.java, its all fine.
But when i compile the CoffeeSelect.java, it reports that the package com.example.model (one in which the CoffeeExpert is present) is unavailable

These are the command prompt reports when i compile the CoffeeSelect.java
(And i have included the import statement for CoffeeExpert in CoffeeSelect.java)
Can you please help me crack this?

D:\Program Files\Jsp and Servlets\coffeeV1>javac -classpath /"D:\Program Files\apache-tomcat-5.5.26\common\lib\serv
let-api.jar" -d classes src/com/example/web/CoffeeSelect.java
src\com\example\web\CoffeeSelect.java:8: package com.example.model does not exist
import com.example.model.*;
^
src\com\example\web\CoffeeSelect.java:19: cannot find symbol
symbol : class CoffeeExpert
location: class com.example.web.CoffeeSelect
CoffeeExpert ce = new CoffeeExpert();
^
src\com\example\web\CoffeeSelect.java:19: cannot find symbol
symbol : class CoffeeExpert
location: class com.example.web.CoffeeSelect
CoffeeExpert ce = new CoffeeExpert();
^
3 errors

and i'm working with jdk 1.6

thanks a bunch

[edit]Take colour tags out. CR[/edit]
 
Peter Johnson
author
Bartender
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The Java compiler needs to know about all of the classes; you can do this by supplying them on the command line:

javac ... src/com/example/web/CoffeeSelect.java src/com/example/model/CoffeeExpert.java

or like this:

javac ... src/com/example/web/*.java src/com/example/model/*.java
 
Suresh Ramanan
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Peter Johnson!!!

wow!!!

Thanks a lot.
The classes got compiled now...
Thanks a bunch...
Hurray! I can proceed with the tutorial now

Best wishes,
Suresh
 
Campbell Ritchie
Sheriff
Posts: 48652
56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to JavaRanch

I have had to change the red writing in your 1st post to black; it was difficult to read.
 
Suresh Ramanan
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
@Campbell Ritchie

Hi!

Thanks for the welcome note.
Sorry i didn't mean to get the text very flashy
I just made it red for emphasis

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic