[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Importing and Using User Defined Classes
- To: Chuck Irvine <Chuck.Irvine@mail.sprint.com>
- Subject: Re: Importing and Using User Defined Classes
- From: Pat <firstname.lastname@example.org>
- Date: Wed, 26 Jan 2000 13:56:46 -0600
- Approved: email@example.com
- Cc: firstname.lastname@example.org, email@example.com
- In-Reply-To: <H00009db043c85f1.0948916380.kcopmp06@MHS>; from Chuck Irvine on Wed, Jan 26, 2000 at 01:53:01PM -0600
- Mail-Followup-To: Chuck Irvine <Chuck.Irvine@mail.sprint.com>,firstname.lastname@example.org, email@example.com
- References: <H00009db043c85f1.0948916380.kcopmp06@MHS>
- Reply-To: firstname.lastname@example.org
On Wed, Jan 26, 2000 at 01:53:01PM -0600, Chuck Irvine wrote:
> 1. I couldn't get the BeanShell that came with the latest jde beta
> distribution to work, so I downloaded it from
What version is the one that came with the JDE?
(It should print the version when it starts up).
> 2. Then I moved bsh to the directory that has the attached file in it.
> Shouldn't have to probably, but I was grasping at straws.
> 3. Then double click in bsh-1.0.jar to invoke the BeanShell desktop.
Well, if you start bsh by double clicking the jar file then Java probably
doesn't have the class path set to include the current directory.
If you could try running bsh from the command line:
java -classpath bsh-1.0.jar;. bsh.Console
that would include both the jar file and the current directory in the path.
I'm going to try to make bsh friendlier about loading classes not in the class
path in the next release.
> 4. Entered at the bsh prompt, taking you advice to not invoke "Impot":
> > Foo foo = new Foo();
> This triggers the bsh error:
> // Error: bsh.EvalError: "Foo" does not resolve to a class name. It is
> undefined. :
> 5. Next I try import and then step # 4 again:
> > import Foo;
> > Foo foo = new Foo(); --- Still hangs here
Yes, I see. I just tried it and it does hang.
I'll investigate why.
In general you should be able to use any class in the class path without
explicitly importing it. e.g.:
So I think you're stubmling over two problems 1) not having Foo in the
classpath and 2) a bug that you've discovered involving importing explicit
(sorry ;) )