NOTE: Please i do not expect everybody to read this on-line, you can copy the pages to a storage device
and take time to go through it or you can also print it out.
Welcome to this thread. Having seen some threads in this forum, I'm happy that so many people
in Nigeria are interested in learning Java. So I have decided to run a couple of threads as
my contribution to developing a strong Java Community in Nigeria. So, if u are among the lucky
ones that have decided to get started with learning Java, never mind, i am here to just get
you started.
Learning Java could be fun and frustrating, depending on the angle you look at it
from.But I'm promising you that I am going to take it real slow and down to earth. I am also going to
go about it from the professional way i.e after finishing, if we ever finish, you should be
strong enough to add little effort and start hitting certification level. So let's get the ball
rolling with the requirements.
1. To learn Java, of course you need a Java Development Tool (jdk) now called J2SE (Java 2 Standard Edition)
from 5.0 version (Code named Tiger). There is a lot of improvement in the new edition, in fact there is a
new version (Code named Mustang) already out but still at a beta (development) stage, the final version
should be out soonest. But be rest assured that it is backward compatible. But Version 5.0 is recommended.
It can be downloaded, which ever version you need from this link.
http://java.sun.com/j2se/1.5.0/download.jspIt is recommended to use Sun Download Manager (SDM) to download the J2SE else you are going to have a frustrating
time downloading it. The SDM can be downloaded from this link and it's easy to use. Read the read me file after
installing it to get cracking.
http://www.sun.com/download/2. Next, you are going to need a java aware text editor, i will recommend TextPad, there is a free evaluation
version you can use. I do not recommend using Integrated Development Environment (IDE) for now. They do shield you
from the real details of the language, and more so, they will always add some IDE specific codes to your application,
this might confuse you. Also debugging your application could be difficult, if you don't know how errors are handled
in java. TextPad can be downloaded from this link.
http://www.textpad.com/download/3. Now that we have all the needed software requirements, installing the J2SE easy for windows but for Linux
you have to do some tweeking to get it and running.For Linux users, if you are unable to install it, please
feel free to post your problems, promise to sort it with you. Next thing is to configure our system and
development environment. You need to add java to your system classpath. If you don't know what is classpath,
never mind, i will explain. It's just a way of telling the system where to look for executable commands. Like
if u type "dir" in your DOS prompt, the system list the content of a directory, because DOS commands are added
to the classpath by default. So let's set the classpath.
a. Right click My Computer icon on the desktop.
b. Select properties.
c. On the System Properties dialog box, select Advanced tab.
d. Click on the Environment Variables button at the bottom.
e. On the System Variables box, select Path under Variables, click Edit button.
f. An Edit System Variable dialog box will show.
g. In the Variable Value text Field, move your cursor to the beginning and add the path to
your J2SE bin folder. eg
C:\Program Files\Java\jdk1.5.0\bin,.
click all the OK to take you back to Environmental Variables dialog box. Here, we are just going
to add another simple System Variable, it for tools that depend on java to run. so
Click the New button, A new System Variable dialog box appears. Just fill as stated below.
Variable Name: JAVA_HOME
Variable Value: C:\Program Files\Java\jdk1.5.0 - don't add the bin folder
after this you can click all the OKs. Be warned, not to remove anything from the path when editing, if u do,
your system might become unstable. So be careful. So, we are through with that. O boy no give up ooh.
To test if everything went kool, click start, run, type cmd and hit enter. Na just to open Dos prompt o.
Type javac
hit enter, you should get a message like this.
Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.
C:\Documents and Settings\Omo>javac
Usage: javac <options> <source files>
where possible options include:
-g Generate all debugging info
-g:none Generate no debugging info
-g:{lines,vars,source} Generate only some debugging info
-nowarn Generate no warnings
-verbose Output messages about what the compiler is doing
<more lines here>
If you get this message all de kampe. If you don't get this message, no yawa, some systems might require a restart,
so do it, if yawa still gas, ma boy, sorry you have to go all over the process again. It's never been easy, getting
it right the first time.
4. Na wa o. I bet you, this is going to be the longest part, we will ever get. It's nice we learn to get it right from
the beginning. Don't worry, this is the last paragraph for today. Setting our development environment. Java has
a recommended file standard structure you should follow, for now we will be doing it ourselves.But in real production
where you have hundreds of sources and class files, you will be using tools like Ant to arrange your file structures. I will just
list the structure.
a. Create a project directory that will contain all our projects folder.
C:\project
b. Create a sub directory, let's call it lecture1 (initial small letter), the name of our current project.
C:\project\lecture1
c. Create a sub folder for lecture1, name it src - it must be named src, source codes (what you write) goes into this folder.
C:\project\lecture1\src
d. Create another sub folder for lecture1, name it classes - must also be named classes and your class files(compiled code) sit here.
C:\project\lecture1\classes
So now we are ready to start the party, but before we go, let's look at area where most beginners encounter problems.Take note.
1. Java is highly type checked. Mean the javac (compiler) will make sure you follow the rules. No short cuts.
a and A are not the same. lagos and Lagos not same, so Lagos must be Lagos throughout your code.
2. White space are ignored. That is spaces between statements except for few exception like in classes,methods and
variables declaration. (if you don't understand, don't panic, we go jump am pass).
3. Class declaration must start with { and end with }.
4. Method declaration must have () immediately after it's name and like classes must start and
end with {}.
5. Every statement must terminiate with ;
Though there are more, but these are what i feel are the most common,
So my boy, me i dey check out. Take your time to digest it and make effort to get the required tool, because
by next class we will write our first program and explain some concept in java using a simple program.
Wish you all the best. To all, including the gurus and alike, please your criticism,observation,contribution and
recommendations are welcome.
Recommended free training site. Highly rated. www.javaranch.comRecommended Text bookHeadFirst Java 5.0 (Second Edition) by Kathy Sierra and Bert Bates.
HeadFirst Java (First Edition - covers version 1.4) by Same authors
Recommended books for Certifications.Sun Certified Java ProgrammerSun Certified Java Programmer 1.4 Exam Guide by Kathy Sierra and Bert Bates.
Note:
The 5.0 version seems not to as good as the 1.4 version
Sun Certified Java Associateno books yet. It's a new exam for entry level.
Sun Certified Web Component Developer 1.4.HeadFirst Servlet and JSP ( rated best in the category) - lots of hands on practice
- simulation of real development paractice
Sun Certified Business Component Developer 1.3.SCBCD EXAM STUDY KIT by Paul Sanghera (free pdf version available on-line)
EJB Specification 2.0 from Sun.
HeadFirst EJB by Kathy Sierra and Bert Bates (Very good teaching approach but some error, corrections available on-line).
Mastering Enterprise JavaBeans 3rd Edition by Ed Roman and co (free pdf version available on-line)
Recommended Bookshop in Lagos.Ebuy (Prices are ok, extra 1k or 1.5k above on-line prices).
Delivering within 2 to 3 weeks.
Call Seun 01-4751491 or
Dolapo 08029494655