• Post Reply Bookmark Topic Watch Topic
  • New Topic

Package problem in walkthrough  RSS feed

 
Ed Connery
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As per Seetharaman Venkatasamy's suggestion, I'm starting a new thread with my question from the Regarding Package thread.

I'm going through the walkthrough in Chapter 3 of Head First Servlets & JSP. It works up to a point (and I can work around that point), but it looks like I should not have to.

The following works:

Directory structure:
C:\Java\HF\bV1\src\com\example\model
C:\Java\HF\bV1\src\com\example\web

From C:\Java\HF\bV1\src:

javac com\example\model\BE.java
javac com\example\web\BS.java
java com.example.model.BE

And this works:

From C:\Java\HF\bV1:

javac -classpath "C:\Program Files\Apache Software Foundation\jakarta-tomcat-5.0.28\common\lib\servlet-api.jar";classes:. -d classes src\com\example\model\BE.java

But this does not, yielding "package com.example.model does not exist" (and note that without the import statement it DOES work):

javac -classpath "C:\Program Files\Apache Software Foundation\jakarta-tomcat-5.0.28\common\lib\servlet-api.jar";classes:. -d classes src\com\example\web\BS.java

I can get the sample to run if I compile locally and then manually deploy the resulting class file, but it doesn't appear that should be necessary.

What am I doing wrong?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!