At the bottom of page 29 one reads "Now compile this source using the Java compiler, javac:
% javac HelloJava.java"
Huh. What's javac? Scrounge around a bit. Yep, reference is made to it in the index, and on page 73 one finds "...about javac, the Java compiler in the SDK." This gives a clue that in order to accomplish anything at all the SDK has to be installed, so install the SDK. Sure enough javac.exe appears.
Using any old editor enter the first, tiny, example the authors provide. This example, produced here for clarity, appears at the top of page 29.
"
public class HelloJava {
public static void main( String[] args) {
Systeml.out.println("Hello, Java!");
}
}
"
Following the authors' instructions, place it in a file called HelloJava.java.
In a DOS window type the line "% javac HelloJava.java" exactly as it appears in the book. An error message appears. Assuming that the authors did not really mean what they wrote, type instead the line "javac HelloJava.java" at the command prompt.
This time the following error message appears.
"Exception in thread "main" java.lang.NoClassDefFoundError: com/sun/tools//javac/Main", and there we are, dead in the water at the very first place we are asked to try anything. Things didn't work the way we were told they would work, and the book provides not the slightest hint about what the problem might be.
I find it difficult to believe that my setup (Win NT 4.0 SP 5) is so unusual that that is what is causing the problem.
I read the first 2 chapters and, since I have been programming computers for about 35 years - and using C++ for about 15, nothing in those 2 chapters was difficult to understand. I don't know what it would be like for someone who had no experience with the object oriented paradigm - probably pretty difficult.
I'll get things working, but I will need something better than this book to get me going.
Finally, I liked the title, but, in the end, it turned out to be very misleading. It is difficult to learn anything, when the examples one is supposed to use don't work as advertised.
|