Hi,
Dale said:
I can tell you why because a program is not usually a single class file.
It is a bunch of class files arranged in a tree of packages. You have to
have some form of class path. Do you expect Java to deduce your class
path to find the rest of the classes?
I know. But in many cases, it would be enough, if java would use a
"default" classpath with the "current" directory (or the directory, in
which the classfile is placed). Indeed, that would be some kind of
deduction, but not very tricky:
Consider, you have some classes: "MainClass" in the default-package and
"packageA.subpackageX.OtherClass". Then your directories would be:
/application/bin/MainClass.class
/application/bin/packageA/subpackageX/OtherClass.class
Now, if you double-click on MainClass.class, what would be the problem
to "guess" where OtherClass is placed?
Two notes:
(1) I know that I must improve this logic, so that jar-files can be
found (as usual, "$APP/lib/*.jar")
(2) As I said: "On the other hand - what's the problem to embed the
classfile in a jarfile? (You can avoid some classpath problems then,
e.g....)"
Ciao,
Ingo
PS: Yes, I am aware that the word "subpackage" does not exist in java,
but I guess you know what I mean by this.