Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Java > Java and JDK > JSP Basics
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
JSP Basics Beginning-level questions on JSP. More advanced coders should post to Pro JSP.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the JSP Basics section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old May 26th, 2004, 05:23 PM
Registered User
 
Join Date: Jul 2003
Location: Bracknell, Berkshire, United Kingdom.
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to kizmit
Default CH7 - import package

I am having problems getting the compiler to find a package :(

In short, I have create a class called "User" and it is stored ....classes/com/wrox/utilities/User.java
I compiled this class fine.

I then create a class called "ListDemova" and saved .../classes/ListDemo.java

The first line of this class says "import com.wrox.utilities.*;"

When I try to compile this class I get the following exception:
ListDemo.java:1: package com.wrox.utilities does not exist
import com.wrox.utilities.*;
^

I really don't understand why it doesn't find my package

Please help.

Many Thanks
Kiz


^


Reply With Quote
  #2 (permalink)  
Old June 1st, 2004, 04:40 AM
Authorized User
 
Join Date: Feb 2004
Location: Jilin, Jilin, China.
Posts: 32
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to cash
Default

if you want to complie you class ,you must make ListDemo.java in the same folder where the user.java was.Or make the user.class in your classpath.Or package your class with jar -cvf ...
and make the class in the jdk\jre\lib\ext
Reply With Quote
  #3 (permalink)  
Old June 3rd, 2004, 03:18 PM
Registered User
 
Join Date: Jul 2003
Location: Bracknell, Berkshire, United Kingdom.
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to kizmit
Default

Still can not get it to work - but thanks for the advise.

I have done everything the book has told me to do. Do you think it could be a problem with the JSDK that I downloaded?

Reply With Quote
  #4 (permalink)  
Old June 9th, 2004, 04:06 AM
Authorized User
 
Join Date: Feb 2004
Location: Jilin, Jilin, China.
Posts: 32
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to cash
Default

Please try this make your java file in the same folder (exp: com/wrox/my/user.java and listdemo.java) and compile with javac com/wrox/my/*.java

Good Luck

Reply With Quote
  #5 (permalink)  
Old June 16th, 2004, 08:00 AM
Authorized User
 
Join Date: Jun 2004
Location: Tirupati, Andhra Pradesh, India.
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Default

hi,

You try to add ../classes to your class path.
..indicates the complete path before /classes
so that the package is avaliable to import by another program.

Hope you will get rid of this problem.

Prasanth.C


prasanth.c
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
HowtoRun package from .asp from Package Store? Tom de Koning BOOK: Professional SQL Server 2005 Integration Services ISBN: 0-7645-8435-9 0 June 21st, 2006 08:08 AM
package and import problem Prince Java Basics 0 May 29th, 2006 06:49 AM
Import Data from a form to a word package aysha Access 0 April 4th, 2005 09:23 AM
Doing ch7 would u help me out? mara JSP Basics 1 November 18th, 2003 09:37 PM



All times are GMT -4. The time now is 11:42 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.