p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   JSP Basics (http://p2p.wrox.com/forumdisplay.php?f=92)
-   -   CH7 - import package (http://p2p.wrox.com/showthread.php?t=13471)

kizmit May 26th, 2004 05:23 PM

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 [V]

Please help.

Many Thanks
Kiz


^



cash June 1st, 2004 04:40 AM

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

kizmit June 3rd, 2004 03:18 PM

Still can not get it to work [V] - 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?


cash June 9th, 2004 04:06 AM

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


prasanthrc June 16th, 2004 08:00 AM

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


All times are GMT -4. The time now is 01:36 PM.

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