• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Compile error

 
Vivek Gajabe
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Page No 84 from Head First Servlet & Jsp.
When i try to compile this program(BeerSelect.java), it shows
1.package com.example.model does not exist.
import com.example.model.*;
^
2.Cannot find symbol class BeerExpert
BeerExpert be = new BeerExpert();
^ ^
The path com.example.model exist & even BeerExpert.java exist,it compiles fine.
But BeerSelect.java can't import BeerExpert.java.
what's the problem?
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
But BeerSelect.java can't import BeerExpert.java. what's the problem?

com.example.model needs to be in the CLASSPATH. For example :
C:/java/src/com/example/model/BeerExpert.java
If you want to BeerExpert, the compiler has to find it. Where does it look for classes ? In the CLASSPATH. So C:/java/src has to be in your CLASSPATH.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic