Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 9 Oct 2001 02:16:15 -0400
From:      Zach Hartley <zhartley@linus.highpoint.edu>
To:        questions@FreeBSD.ORG
Subject:   Re: java newbie question
Message-ID:  <20011009021615.A24085@linus.highpoint.edu>
In-Reply-To: <20011009015727.A18835@sympatico.ca>; from david@skytrackercanada.com on Tue, Oct 09, 2001 at 01:57:27AM -0400
References:  <20011009015727.A18835@sympatico.ca>

next in thread | previous in thread | raw e-mail | index | archive | help
*LOL* small world, I'm currently learning java with the same book by Walter
Savitch! I think I know what your problem is too. Have you checked to make
sure teh SavitchIn.java source file is in the current directory that you're
trying to compile in? e.g.

#ls
hello.java SavitchIn.java

If you don't have SavitchIn.java in the directory that you're compiling,
it'll spit that error out at your because it doesn't know the about the
class you're referencing. If you have any other problems, email me
off-list, since I've been using the same book, with jdk1.3.1 on freebsd for
about a month or two now. 

HTH

Zach

Around Tue, Oct 09, 2001 at 01:57:27AM -0400, David Banning said something to the effect of:
> I am starting out running jdk 1.3.1.01 and I am utilizing Walter Savitch's
> book on Java.
> 
> While my "Hello World" program compiles & runs fine, the first example in his
> book utilizes a required class file. (SavitchIn.java)
> 
> The first tutorial, FirstProgram.java, calls class "SavitchIn"
> and method "readLineNonwhiteChar", but I get the error;
> 
> bash-2.03$ javac FirstProgram.java
> FirstProgram.java:10: cannot resolve symbol
> symbol  : variable SavitchIn  
> location: class FirstProgram
>         answerLetter = SavitchIn.readLineNonwhiteChar();
> 
> 
> It seems it cannot find the class file SavitchIn. I thought that
> could be handled by setting the CLASSPATH variable, but I have
> tried several settings with no change in result. Walter's book does
> not cover this, and neither does the Java tutorial I have found
> for starting with Sun java.
> 
> I have an idea that the answer here is a simple one...
> 
> The program follows; (the problem wouldn't be the ^M's would it?)
> 
> public class FirstProgram^M
> {^M
>     public static void main(String[] args)^M
>     {^M
>         System.out.println("Hello out there.");^M
>         System.out.println("Want to talk some more?");^M
>         System.out.println("Answer y for yes or n for no.");^M
> ^M
>         char answerLetter;^M
>         answerLetter = SavitchIn.readLineNonwhiteChar();^M
>         if (answerLetter == 'y')^M
>                System.out.println("Nice weather we are having.");^M
> ^M
>         System.out.println("Good-bye.");^M
> ^M
>         System.out.println("Press enter key to end program.");^M
>         String junk;^M
>         junk = SavitchIn.readLine();^M
>     }^M
> }
> 
> To Unsubscribe: send mail to majordomo@FreeBSD.org
> with "unsubscribe freebsd-questions" in the body of the message

-- 
Zachary Todd Hartley
"Attempted murder. Now honestly, what is that?
Do they give a Nobel Prize for attempted chemistry?"
	--Sideshow Bob

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20011009021615.A24085>