• 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:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Junilu Lacar
  • Liutauras Vilda
Sheriffs:
  • Paul Clapham
  • Jeanne Boyarsky
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
Bartenders:
  • Jesse Duncan
  • Frits Walraven
  • Mikalai Zaikin

Compile problem

 
Ranch Hand
Posts: 167
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I have started to read the Head First Servlets & JSP and trying to deploy the web application in MVC Tutorial (Chapter 3). I get the following error when i want to compile:


D:\headfirstservlet\coffeeV1>javac -classpath c:\programme\apache\tomcat\common\lib\servlet-api.jar -d classes src\com\example\web\CoffeeSelect.java
src\com\example\web\CoffeeSelect.java:3: package com.example.model does not exist
import com.example.model.*;
^
src\com\example\web\CoffeeSelect.java:20: cannot find symbol
symbol : class CoffeeExpert
location: class com.example.web.CoffeeSelect
CoffeeExpert ce=new CoffeeExpert();
^
src\com\example\web\CoffeeSelect.java:20: cannot find symbol
symbol : class CoffeeExpert
location: class com.example.web.CoffeeSelect
CoffeeExpert ce=new CoffeeExpert();
^
3 errors


In CoffeeSelect.java i have
package com.example.web; and import com.example.model.*; statements.
In CoffeeExpert.java i have
package com.example.model; statement.

Why does my CoffeeSelect.java not compile? What i miss?
Thanks for any help.
[ December 15, 2005: Message edited by: Kudret Serin ]
 
Ranch Hand
Posts: 168
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

It is not able to find the class file for coffeeExpert..that is the pblm..make sure it is compiled well before and has been set in the classpath.

hth..

Regards,
Priya.
 
Kudret Serin
Ranch Hand
Posts: 167
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I have CoffeeExpert.class file in D:\headfirstservlet\coffeeV1\classes\com\example\model
 
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Kudret ,


compiler is not seeing ur class com.example.model.CoffeeExpert1 since u mite have not specified in your classpath.

you can include dynamically with the followiing commnd like this..

javac -classpath c:\programme\apache\tomcat\common\lib\servlet-api.jar;D:\headfirstservlet\coffeeV1\classes\com\example\model -d classes src\com\example\web\CoffeeSelect.java

hope this helpss
 
Kudret Serin
Ranch Hand
Posts: 167
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I tried it too, i still get the same error. In NeatBeans, i created a web application with existing source and compilation succeeds.But i want to compile und edit all the things manuell, without support of any IDE.
I still can not find the reason (everything seems to be ok). I should take a break before trying again. I lost too much time for it.
:roll:
 
pie. tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic