compiling interfaces

Hi,

I have an interface Compute.java

package compute;

import java.rmi.Remote;

import java.rmi.RemoteException;

public interface Compute extends Remote {

Object executeTask(Task t) throws RemoteException;

}

Also there is one more interface in the same package "Task.java".

package compute;

import java.io.Serializable;

public interface Task extends Serializable {

Object execute();

}

Now these two files are placed in compute directory whose path is

C:\sharvan\src\compute

I tried compiling Compute.java interface using the follwing command

C:\Myjava\mine\sharvan\src> javac compute/Compute.java

But ended up getting the following error

compute/Compute.java:7: cannot resolve symbol

symbol : class Task

location : interface compute.Compute

Object executeTask(Task t) throws RemoteException;

I downloaded these interface files from RMI trail in the Java tutorial.

Any idea how to rectify this error.

Thanks,

sharvan

[1108 byte] By [sharvan11] at [2007-9-30 12:27:50]
# 1
Dear sharvan,since you r using interface Task.java in cumpute.java, you must first compile Task.java and finally compile Compute.java. command are correct however sequence of use must be taken care off.reply if you face any other problem.bye M.M
MAHIM_MISHRA at 2007-7-4 15:57:57 > top of Java-index,Administration Tools,Sun Connection...
# 2

sharvan,

MAHIM_MISHRA's comments are incorrect. The order in which you compile the classes is irrelevant when using javac.

The problem is that your src directory is not on your compile-time classpath or sourcepath. The fact that Task.java is in the same directory as Compute.java is irrelevant if that directory cannot be found by searching the classpath.

For now, use the following command line to compile:

C:\Myjava\mine\sharvan\src> javac -classpath . compute/Compute.java

Then look up classpath and sourcepath in your Java books and online. Search these forums and you'll find plenty of old threads about it.

mattbunch at 2007-7-4 15:57:57 > top of Java-index,Administration Tools,Sun Connection...
# 3
It worked.Thanks loads.
sharvan11 at 2007-7-4 15:57:57 > top of Java-index,Administration Tools,Sun Connection...