• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Unable to import

 
Ranch Hand
Posts: 165
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all

I am running an example of third cgapter of Head First Servlet and JSP

In that i have created two directories like

C:\Tomcat 6.0\webapps\Beer-v1\WEB-INF\classes\com\example\web

which contains while called BeerSelect.java

and second

C:\Tomcat 6.0\webapps\Beer-v1\WEB-INF\classes\com\example\model
which contains file called BeerExpert.java

now when i am import the package Model one in BeerSelect class which is in WEB package its showing an erroe that package doesnot exist




Can anyone of you plaese help me

 
Rancher
Posts: 3742
16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Did you include C:\Tomcat 6.0\webapps\Beer-v1\WEB-INF\classes in your classpath ?
 
deepak carter
Ranch Hand
Posts: 165
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
let me try
 
deepak carter
Ranch Hand
Posts: 165
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i went to enviromental vaiable and set the path which we have mentioned but no luck...same error
 
Bartender
Posts: 4568
9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How are you compiling it? If you're doing it from the command line, what folder are you in and what's the exact command you're running?
 
deepak carter
Ranch Hand
Posts: 165
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
any solution???
 
Matthew Brown
Bartender
Posts: 4568
9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

deepak carter wrote:any solution???


You expect an answer within 10 minutes? EaseUp.
 
deepak carter
Ranch Hand
Posts: 165
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ok


After writing the import com.example.model.*; in BeerSelect class which is in com.example.web package

i am compiling like this..

C:\Tomcat 6.0\webapps\Beer-v1\WEB-INF\classes>javac com/example/web/BeerSelect.java


Its showing

package com.example.model does not exist
 
deepak carter
Ranch Hand
Posts: 165
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
any solution to the above problem?
 
Java Cowboy
Posts: 16084
88
Android Scala IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I still don't see any evidence that you've set your classpath correctly. Try this:

javac -cp .;C:\Tomcat 6.0\webapps\Beer-v1\WEB-INF\classes com/example/web/BeerSelect.java
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic