Thursday, September 18, 2008

Where to start?

Editorial Note:

This blog was written three years ago, since when Sun has been acquired by Oracle. Pretty much all of the links to the Java tutorial have therefore become wrong. I shall attempt to correct as many as possible, but if I miss any, please use the link given below to get to the main page, and navigate manually from there.

The documentation that came with JDK6 led me to “The Java Tutorials” at:

Full of optimism I hit the link to the “Getting Started” trail.

The first link in this trail is entitled “The Java Technology Phenomenon”, and without any hard feelings intended, I have to describe it as pretty boring. If I might generalise from a very small sample, I think a possible criticism of the whole tutorial is that it is written by some of the leading experts in the field – people who have been working for so long with this stuff that they have spinal reflexes for many tasks, which the new user might find quite daunting. They are also ideological purists. They really are interested in the whole theory of the thing.

To an academic, or even a student who wants to make a lifelong career of programming, this stuff might indeed be interesting. But to an old dog like me, who just want to write a few lines of code, it’s information I’d rather see in an appendix at the back of the book, rather than in my face in Chapter One.

The second link in the thread, Hello World, is more practical, if a little tired, and irritatingly trivial.

It is in my nature to be methodical, so I followed the trail in sequence, beginning with “"Hello World!" for the NetBeans IDE”. Dutifully, I downloaded NetBeans and installed it. I should perhaps add at this stage that I am doing all this on a rather old laptop. It is a PIII with 500 MBRAM. It is obviously not a tool for programming in a sophisticated IDE. For me it is more a diary and travelling companion. So it is not in the nature of a complaint when I observe that NetBeans is quite a resource hungry application. It took almost two minutes to load on my old box, and took system memory utilisation over 80%. So for anyone out there with less than a brand new machine, NetBeans is not a light app. Using it to draft “Hello World!” is a classic sledge hammer to crack a nut!

When I moved on to the page headed “"Hello World!" for Microsoft Windows” I thought my trusty old PIII box would perform the task swimmingly. Apart from the JRE, which was already installed, all I needed was a text editor.

But it was not to be the case. I got the message “'javac' is not recognized as an internal or external command, operable program or batch file”. And when I went to the troubleshooting page and followed the instructions, it still didn’t work. I know older machines exhibit idiosyncratic problems, and I appreciate that all this stuff is free, but it was still infuriating.

The only way I could get the LinkHello World! source code to compile was to copy the source file into the jdk6\bin\ folder on my computer and run javac from there. I used this cheat for the remainder of the tutorials.

No comments: