Thanks a lot. Everything is working.
Now, I just hope to ask a couple more questions.
(1) For my case, after compiling, my own package SavitchIn.class is
located in
~/programming/java/Tools/classes/tools/savitchTools/SavitchIn.class
The java file SavitchIn.java is located in
~/programming/java/Tools/src/SavitchIn.java
(
with the line on the top:
package tools.savitchTools;
)
To know what is inside this package, I need to open and read
SavitchIn.java, not SavtichIn.class.
My question is, how about the original packages came with Java, say
java.io.*. Where are their class files and where are their java files? I
hope to open and read their java files as I can with my own package
java file SavitchIn.java.
I know I can find all java packages and what the insides are in the
sun's java web page. But I still hope to find them out on my own machine.
(2) Is package strategy rarely used by java programmers? (It seems you
are the only person knowing about it.)
Thank you very much.
> Thanks a lot. Everything is working.
>
[quoted text clipped - 13 lines]
> To know what is inside this package, I need to open and read
> SavitchIn.java, not SavtichIn.class.
You (a human) need the .java file, but the compiler & runtime environment
need the .class file.
> My question is, how about the original packages came with Java, say
> java.io.*. Where are their class files and where are their java files?
[quoted text clipped - 5 lines]
> sun's java web page. But I still hope to find them out on my own
> machine.
As stated above, the computer doesn't need the .java files to compile or
run your programs, only the .class files. These are located in several
jar files. You can find the standard jar files in the lib subdirectory
of your java installation. If you are interested you can extract the
class files from these jar files - but they won't help you much, since
they're not source files.
However, the JDK comes with the java source files as well. In your JDK
installation directory, you should have the src.zip file. This contains
all the java files. They are an interesting read, although you can't
expect to understand all of it right away.
> (2) Is package strategy rarely used by java programmers? (It seems you
> are the only person knowing about it.)
lol no, packages are used in any non-trivial project. I suppose the
other posters here just saw that I already answered, so they didn't bud
in :-)

Signature
Beware the False Authority Syndrome