Cannot Find File

hello!

I am inporting the concurrent package of Doug Lea insice my class

The LinkedQueue.java which i am importing looks like this

/*

** File: LinkedQueue.java

*/

package EDU.oswego.cs.dl.util.concurrent;

publicclass LinkedQueueimplements Channel{

protected LinkedNode head_;

protectedfinal Object putLock_ =new Object();

............

public LinkedQueue()

............

i call the object like this

import concurrent.*;

...

private LinkedQueue urlQ=new LinkedQueue();

where the concurrent.*;

is the path where the file resides.

The error is like this

bad class file: C:\Users\Giorgos\Concurrency\concurrent\LinkedQueue.java

file does not contain class concurrent.LinkedQueue

Please remove or make sure it appears in the correct subdirectory of the classpath.

private LinkedQueue urlQ=new LinkedQueue();

^

[1417 byte] By [georousa] at [2007-10-2 9:15:35]
# 1
Did you extract this class from a jar? It has to be in the directory of the for <parent>/<package> where parent is some directory on your classpath and <package is the packge declared for the class.But why did you extract it?>
cmccorveya at 2007-7-16 23:22:43 > top of Java-index,Developer Tools,Debugging and Profiling Tool APIs...
# 2

Hi,

what i feel is you have to import package like as following

import EDU.oswego.cs.dl.util.concurrent.*;

because LinkedQueue class will be present under hiearchy "EDU.oswego.cs.dl.util.concurrent".If you specify import concurrent.*; then JVM look for a package name "concurrent" and NOT a "EDU.oswego.cs.dl.util.concurrent"

- Uday

UdayTashildara at 2007-7-16 23:22:43 > top of Java-index,Developer Tools,Debugging and Profiling Tool APIs...