A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Win a copy of
Head First Android
this week in the
Package does not exist ?
Joined: Jun 28, 2008
Oct 16, 2008 17:38:00
I have a
file called "BeerSelect.java" in
C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps\Beer-v1\WEB-INF\classes\com\example\model
I have another java file called "BeerExpert.java" in
C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps\Beer-v1\WEB-INF\classes\com\example\web
In BeerSelect.java, I have a code import com.example.model.*;
When I compile the BeerSelect.java file it gives the error:
package com.example.model does not exist.
I hope I've set my classpath correctly.
C:\Program Files\Apache Software Foundation\Tomcat 5.5\common\lib\servlet-api.jar.;
C:\Program Files\Apache Software Foundation\Tomcat 5.5\common\lib\jsp-api.jar.;
C:\Program Files\Java\jdk1.6.0_06\lib.;c:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps\beer-v1\WEB-INF\classes
All opinions and suggestions are welcomed. Thank you.
EDIT : Please ingore this post. I found the answer!!! Immediately after I posted this topic, I noticed that the "beer-V1" was in small letter instead of capital letter "B".
The classpath was wrong. argh.
[ October 16, 2008: Message edited by: LS chin ]
I agree. Here's the link:
subject: Package does not exist ?
Problem Compiling Beer servlet example in HF
TAG class compilation error
package com.example.model.* does not exist ERROR head first servlets
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2015