I am working on the Head
Servlet&
JSP book projects. I can not recognize import packages and can not compile.
can anyone so kindly help me about this? I google online about the classpath. but I might misunderstand it. Please help me about this Thanks!
There is a problem about javac compiling. Here is my development directory structure
project directory C:\Users\myname\Documents\JSP\MyProject\beerV1
under beerV1 I followed the book,
the BeerSelect.java source file is in C:\Users\myname\Documents\JSP\MyProject\beerV1\src\com\example\web
the BeerExpert.java source file is in C:\Users\myname\Documents\JSP\MyProject\beerV1\src\com\example\model
the code of BeerSelect.java
the code of BeerExpert.java compiled with commandline under windows7:
C:\Users\myname\Documents\JSP\MyProject\beerV1\src\com\example\model> javac -classpath C:\tools\tomcat\lib\servlet-api.jar -d C:\Users\myname\Documents\JSP\MyProject\beerV1\classes BeerExpert.java
it comiled and generated the BeerExpert.class under directory C:\Users\myname\Documents\JSP\MyProject\beerV1\classes\com\example\model
when I try to compile the BeerSelect.java it can not import package com.example.model.BeerExpert.class Here is my commandline to compile BeerSelect.java
C:\Users\myname\Documents\JSP\MyProject\beerV1\src\com\example\web> javac -classpath C:\tools\tomcat\lib\servlet-api.jar; C:\Users\myname\Documents\JSP\MyProject\beerV1\classes\com\example\model\*.class:. -d C:\Users\myname\Documents\JSP\MyProject\beerV1\classes BeerExpert.java