• Post Reply Bookmark Topic Watch Topic
  • New Topic

Problem in JSp & Servlet  RSS feed

 
Varatharuban B
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I study Head First JSP & Servlet.In chapter 3 (Mini MVC tutorials) I have a problem.In the second example (beer_v2),when I compile the servlet file there are some errors gives by the compiler.

First program working properly.

I build directory structure properly.

Can you give any solutions.
---------------------------------------------------------

E:\Java\SCWCD\Chapter_3\beer_v3>javac -d classes src\com\example\web\BeerSelect.
java
src\com\example\web\BeerSelect.java:3: package com.example.model does not exist
import com.example.model.*;
^
src\com\example\web\BeerSelect.java:22: cannot find symbol
symbol : class BeerExpert
location: class com.example.web.BeerSelect
BeerExpert be = new BeerExpert();
^
src\com\example\web\BeerSelect.java:22: cannot find symbol
symbol : class BeerExpert
location: class com.example.web.BeerSelect
BeerExpert be = new BeerExpert();
^
3 errors

E:\Java\SCWCD\Chapter_3\beer_v3>

-----------------------------------------------------------------------
Thanks in advance.

Regards,
Varatharuban.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66306
152
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"Varatharuban B", please check your private messages for an important administrative matter.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It looks like you haven't set up your classpath properly.
I'm going to move this to our Java In General forum where classpath issues are normally discussed.
 
Khushwinder Chahal
Ranch Hand
Posts: 128
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ben is right there is problem with your classpath.
You need to set it before compiling your servlet class.
 
Gladwin Burboz
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This should help you set class path

http://java.sun.com/j2se/1.3/docs/tooldocs/win32/classpath.html

http://en.wikipedia.org/wiki/Classpath_(Java)
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!