Package problem - PLEASE HELP.

G

Gandu

Could some Java Guru help me? I have a subdirectory(named Testpackage) inside
a directory(named Tempjava). The subdirectory Testpackage contains an
interface(Testinterface.java) and a concrete class that implements that
interface(Test.java). If I get into the directory Tempjava and type:
javac Testpackage/Test.java
I get the error message:
Testpackage/Test.java:5: cannot resolve symbol
symbol : class Testinterface
location: class Testpackage.Test
public class Test implements Testinterface{
^
1 error

I have included the interface class and concrete class below:
//Testinterface.java
package Testpackage;

public interface Testinterface{
void doit();
}
//Test.java
package Testpackage;

import java.io.*;

public class Test implements Testinterface{

public void doit(){}

public static void main(String [] args){
System.out.println("Implementing interface in package");
}
}

Could someone please tell me what exactly to do to get around this
problem. Thanks in advance for your help.
 
B

Brad BARCLAY

Gandu said:
Could some Java Guru help me? I have a subdirectory(named Testpackage) inside
a directory(named Tempjava). The subdirectory Testpackage contains an
interface(Testinterface.java) and a concrete class that implements that
interface(Test.java). If I get into the directory Tempjava and type:
javac Testpackage/Test.java
I get the error message:
Testpackage/Test.java:5: cannot resolve symbol
symbol : class Testinterface
location: class Testpackage.Test
public class Test implements Testinterface{

Make sure you have Tempjava in your CLASSPATH. Either that, or go into
Testpackage and run "javac *.java" to compile everything at once.

Brad BARCLAY
 
B

Brad BARCLAY

Roedy said:
packages and the directories that contain them should have lower case
names. They had better match precisely.

Not necessarily. The only element in the spec that specifically
_requires_ lower-case characters is the TLD (which in the JLS v1.0 spec
was supposed to be all uppercase).

Everything after the TLD has no specific case requirements.

Brad BARCLAY
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Staff online

Members online

Forum statistics

Threads
473,764
Messages
2,569,566
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top