Three things I wish I’d known before …

… starting the Sun Java tutorial

It’s been over a month since the last blog entry and it’s been a busy month:
finishing off projects
planning a holiday biking round the south of france on a GSXF
getting a new job.

The new job was the impetus to take on the java tutorial, trying to get my head around strict typing, odd syntax, compiling code and a whole new API. That’s all hard enough but most of the brickwalls I’ve been banging my head against aren’t down to understanding the language… they are down to how Java is set up and the environment it expects. I feel like I learnt the lessons all in the wrong order.

So for my memory and others out there who’s javac won’t run and whose java class cannot be found, here were my Three Things I Wish I’d Learnt First…

[edit jan 2015]
those three things got lost… so the real lesson is when porting an old blog from one site to another:

  • always make sure your blog software was kept up to date
  • check the source of your posts for substituted rubbish
  • prune old posts vigorously!

One thought on “Three things I wish I’d known before …”

  1. An alternative to the CLASSPATH environment variable is providing the path on the command line. I.e.

    java -cp d:myclasses MyClass

    (-cp can also be written as -classpath)

    This is more useful when you have multiple Java applications and may have name classes between classes. I tend to use a shell script to lauch apps.

    Another gotcha to look out for on case insensitive file systems is the source/class file naming. A class such as MyHelloWorldClass has to exist in files called and MyHelloWorldClass.class otherwise you will get errors *except* on case insensitive file systems. So, on Windows say, you may not realise the problem until someone else tries to run it on UNIX.

    Finally look at Eclipse. Its a damn good Java development environment and removes all the needs for class paths and what not.

Comments are closed.