Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Compile problem

 
Kudret Serin
Ranch Hand
Posts: 167
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • 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 ]
 
Priya Jothi
Ranch Hand
Posts: 168
  • Mark post as helpful
  • send pies
  • 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
  • Quote
  • Report post to moderator
Hi,
I have CoffeeExpert.class file in D:\headfirstservlet\coffeeV1\classes\com\example\model
 
Rajesh Vijaya
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • 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
  • 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:
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic