Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Java > Java and JDK > JSP Basics
| 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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #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


^


  #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
  #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?

  #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

  #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


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





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.