Win a copy of Head First Android this week in the Android 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Rob Spoor
  • Devaka Cooray
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • Tim Holloway
Bartenders:
  • Jj Roberts
  • Al Hobbs
  • Piet Souris

Can you help me get this file compiled?

 
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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]
 
author
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Marshal
Posts: 74354
334
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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

reply
    Bookmark Topic Watch Topic
  • New Topic