This week's book giveaway is in the OCMJEA forum. We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line! See this thread for details.
I am trying to run the first application in MVC in HFSJ.
Some how it's not recognizing the first import statement .
I am getting the error "package com.example.model does not exist"
Here's the code :
BeerSelect Java file
The directory structure is
beerV1 --> classes --> com --> example -->web -->
beerV1 --> classes --> com --> example -->model --> BeerExpert.class
beerV1 --> src --> com --> example -->web --> BeerSelect.java
beerV1 --> src --> com --> example -->model --> BeerExpert.java
The command line
" javac -classpath "C:/program files (x86)/Apache Software Foundation/Tomcat 5.5/servlet-api.jar" -d classes src/com/example/web/BeerSelect.java"
I am executing it from the beerV1 folder.
I know it's something small and silly . Just can't pin it
The future belongs to those who believe in the beauty of their dreams.Dream BIG!
When you try to compile BeerSelect.java your classpath must contain 2 entries: one for the servlet api and one for the already compiled BeerExpert class. Your classpath just contains an entry fpr the servlet api, so that's why it is not compiling.
javac -cp classes;"C:/program files (x86)/Apache Software Foundation/Tomcat 5.5/servlet-api.jar" -d classes src/com/example/web/BeerSelect.java should do the trick