I don't understand why when i create package from the same folder as my main source file the package is not seen. But when i create my package form a folder in another directory than the main source file it's working fine. ex: folder1, main.java, test1.java. When i compile javac -d . test1.java to create package testPackage ,i cannot access test1.class with import testPackage.*; as javac main.java.If i have test1.java in folder2 and i compile the same way javac -d .. test1.java now it compile main.java with the import testPackage.* correctly
Your folder name needs to be same as your package name... do you have that? Try checking out this thread for more information: Problem importing class [ June 11, 2002: Message edited by: Jessica Sant ]
ok (sorry) me again if i put all my java file for the package like this 1- from f:\mailbox
and i store my java files for the package in mailbox directory and create my package from f:\mailbox directory javac -d . Message.java javac -classpath . -d . MailBox.java javac -classpath . -d . TextMessage.java javac -classpath . -d . VoiceMessage.java javac -classpath . -d . Console.java i get the same tree structure as mentioned above as in the previous post message. But compiling javac MialBoxTest.java do not go , it looks like if i have the java file for the package in the same directory as my MailBoxtest.java ,it seem to interfere while compiling???
[ June 11, 2002: Message edited by: Francois Boisvert ] [ June 11, 2002: Message edited by: Francois Boisvert ]
Yes your are right, MailBoxTest belong to default package, but my main concern is to understand why the compiling do not go properly when i have my java source files for my package in the same directory(mailbox) as my main application MailBoxTest.java. This does not happen when my java files for my package are outside of mailbox directory.It is just a matter of moving them in a different directory...without recompiling the package files.It compile ok using import cdi.message.* It seem that the resolution for package/class naming is not ok , i frankly have difficulty to undersand why?