aspose file tools*
The moose likes Servlets and the fly likes error in importing packages (import com.example.model.*) HELP!!! Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "error in importing packages (import com.example.model.*) HELP!!!" Watch "error in importing packages (import com.example.model.*) HELP!!!" New topic
Author

error in importing packages (import com.example.model.*) HELP!!!

Mercedes Regidor
Greenhorn

Joined: Oct 20, 2004
Posts: 2
Hi everyone, I'm a newbie and I came across your board while searching for a solution to my problem. I believe that this has already been brought up as a question in some of the forums here:

------------------------
the problem was this:
src/com/example/web/CoffeeSelect.java:3: package com.example.model does not exist
import com.example.model.*;
^
src/com/example/web/CoffeeSelect.java:4: package javax.servlet does not exist
import javax.servlet.*;

------------------------

------------------------
and the solution was:
javac -classpath c:\dev\tomcat\common\lib\servlet-api.jar:classes:.;c:\j2sdkee1.3.1\lib\j2ee.jar;c:\dev\MyProjects\beerV1\classes -d classes src/com/example/web/BeerSelect.java
------------------------

Unfortunately, adding the class directory to my classpath didn't solve the problem. I still kept on getting the:

------------------------
src/com/example/web/CoffeeSelect.java:3: package com.example.model does not exist
import com.example.model.*;

------------------------

Can somebody shed me a light on this, please? I'm using WindowsXP and I tried tinkering with the environment variables in the System Properties. They all worked for the other compilations except for this one particular thing on importing packages.

Thanks so much!
Mercedes Regidor
Greenhorn

Joined: Oct 20, 2004
Posts: 2
Wait, the thing above, it worked for me! Sorry about the hassle.

My problem now is how to set the WinXP environment variables so that I won't type the whole thing everytime I try to compile my source files.
Sonny Gill
Ranch Hand

Joined: Feb 02, 2002
Posts: 1211

I dont have win xp handy, but on some windows versions, you can get to the environment variables setup applet by right clicking 'My Computer' choosing Properties and the choosing the 'Advanced' tab. You should also be able to get to System Properties somewhere from the Control Panel.

Try choosing help from the Start button, and searching for environment variables.

HTH


The future is here. It's just not evenly distributed yet. - William Gibson
Consultant @ Xebia. Sonny Gill Tweets
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12806
    
    5
Also - if you are serious about Java servlet development, learn to use ANT to control compilation and perform related tasks. The learning curve to start is pretty steep, but it pays off. For one thing, defining different classpaths for different projects is very easy.
Bill
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: error in importing packages (import com.example.model.*) HELP!!!