The Java VM is expecting to find the Foo class in a subdirectory call
foobar. To solve this problem go to the directory ../foobar and try "java
foobar.Foo" . This is essentially telling the JVM that you wish to run the
class file "Foo" in package "foobar".
Happy hacking,
peter
-O
Roland,
Give the package name foobar.Foo to the VM. Otherwise, it's looking
for a file Foo.class in your current directory, but you moved it to
directory foobar.
See trace below.
Vartan
$ pwd
/home/vartan/scratch
$ ls
Bar.java Foo.java READMEfoobar
$ javac *.java
$ ls
Bar.class Bar.j
"java" takes the *class* name of the class to execute, not the *file* name
of the classfile; try this:
java foobar.Foo
instead.
Ted Neward
Patterns/C++/Java/CORBA/EJB/COM-DCOM spoken here
http://www.javageeks.com/~tneward
"I don't even speak for myself; my wife won't let me." --Me
-Origin
Roland Silver wrote:
>
>
> Current directory is /home/rollo/Java/foobar, and
> CLASSPATH specifies the following three paths:
>/usr/local/jdk117_v3/lib/classes.zip
>/home/rollo/TIJ/exercises
>/home/rollo/Java
>
> The command
>javac Foo.java
> compiles OK, as does
>javac Bar.