Please correct me if I am wrong?
The following package struture is available on Windows 2000
I thought javac &
java use the same searching
patterns for compiling and runing the file.
So if the following compilation works fine
quote
-------------------------------------------------
C:\foo>javac FooSample.java
-------------------------------------------------
then the following invocation of the file should have worked fine, but it didn't
Got the error
quote
-------------------------------------------------------------------
C:\foo>java FooSample
Exception in
thread "main" java.lang.NoClassDefFoundError: FooSample (wrong name: foo/FooSample)
-------------------------------------------------------------------
And the reason I guess is - the JVM Searches for a file FooSample without a package which is not present and hence error
but why did the compilation succeed in the first place?
Can anyone please explain me? Really struggling a lot to understand classpaths properly
[ April 01, 2008: Message edited by: Prem Vinodh ]
[BPSouther: Added
code tags to preserve indents in directory listing]
[ April 01, 2008: Message edited by: Ben Souther ]