Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Package does not exist ?

 
Ls chin
Ranch Hand
Posts: 99
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have a java 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.
import com.example.model.*;
^

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 ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic