From owner-freebsd-questions Mon Oct 8 23:17:17 2001 Delivered-To: freebsd-questions@freebsd.org Received: from linus.highpoint.edu (linus.highpoint.edu [192.154.46.106]) by hub.freebsd.org (Postfix) with ESMTP id 7FACC37B405 for ; Mon, 8 Oct 2001 23:17:10 -0700 (PDT) Received: (from zhartley@localhost) by linus.highpoint.edu (8.11.2/8.11.2) id f996GFq24122 for questions@FreeBSD.ORG; Tue, 9 Oct 2001 02:16:15 -0400 Date: Tue, 9 Oct 2001 02:16:15 -0400 From: Zach Hartley To: questions@FreeBSD.ORG Subject: Re: java newbie question Message-ID: <20011009021615.A24085@linus.highpoint.edu> Mail-Followup-To: questions@FreeBSD.ORG References: <20011009015727.A18835@sympatico.ca> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20011009015727.A18835@sympatico.ca>; from david@skytrackercanada.com on Tue, Oct 09, 2001 at 01:57:27AM -0400 Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG *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