The Artima Developer Community
Sponsored Link

Legacy Java Answers Forum
September 2001

Advertisement

Advertisement

This page contains an archived post to the Java Answers Forum made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.

Message:

simple java exception

Posted by nkd on September 30, 2001 at 1:04 AM

I have a very silly question. Let's say I have two classes. One named TextReader.java and the other named LeapYear.java. Let's also say that LeapYear.java creates a new instance of TextReader named keyboard. Both of these files reside in the same folder. There are no defined packages. When I run my code in JBuilder, it runs perfectly, no errors. I can compile TextReader from the command prompt (with javac) with no problems. When I try to compile LeapYear from the command prompt with javac, I get the following error:

C:\test>javac LeapYear.java
LeapYear.java:7: cannot resolve symbol
symbol : class TextReader
location: class LeapYear
TextReader keyboard = new TextReader();
^
LeapYear.java:7: cannot resolve symbol
symbol : class TextReader
location: class LeapYear
TextReader keyboard = new TextReader();

If both of these files are located in the same folder, why can't javac find TextReader? This seems like such a simple thing, I must be missing something obvious.



Replies:

Sponsored Links



Google
  Web Artima.com   
Copyright © 1996-2009 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us