|
|
Free Java FAQS
- How to get Java in my PC?
First you must get either the J2SE Software Development Kit (SDK) or
the J2SE Java Runtime Environment (JRE) in your computer from the Sun
download site. If you would
just need to run Java applets/applications (or need the plugin for your
browser) then you are ok with the JRE (which is only about 10 mb, a
quarter of the size of the SDK). Download the SDK (which already
includes JRE) if there is a need to compile source files. (If you need
to program in Java, then just download the SDK.) As a word
of caution, if you can obtain the source files, better leave the
binaries (class files) behind and just compile it in your own computer.
This would save precious internet bandwidth not to mention saving you
from possible risk (ie any binary file is susceptible to virus or it
maybe a trojan).
In Linux, the SDK (or perhaps also the JRE) is packaged (two package
versions) in a self
extracting file. Run that file
in the command line, to extract. If you choose the rpm version (get
this if your distro uses rpm like Mandrake, Redhat, Fedora), the SDK
would be installed in /usr/java (ie there would be a folder
/usr/java/j2sdk1.4.2_02/jre). If not, the other version (recommended if
you have a non-rpm distro) would extract the j2sdk directory sructure
and you should move it to /usr/java.
- What version of Java to download?
If you are downloading the JRE just get the latest version. If not,
(say you are programming in Java) you have to take into consideration
the Java version of your peers or whoever else will be compiling your
sources or will use your programs. For example, your teacher is using
1.2 then I do suggest getting that version instead or a lot of bad
things may happen (if you can, download also a recent version). Say
this or that functions do not exist in your
teacher's version. It is interesting to note that Color.BLUE should be
Color.blue in earlier versions of Java.
If you will be developing, don't jump into the latest version Sun has
to offer. Though Sun products are always assured to be of high quality,
the market may not be fast to adapt. As of the time I wrote this, 1.5
has just been released but 1.4 is certainly already really stable and
robust.
- How to set up the Java paths?
Hmmm.. I am a little tempted to say that you should consult the
installation instructions of the j2sdk. But that is as bad as saying
RTFM. Well, I better be a good man and tell you
(I didn't consult those intructions anyway) how I configured my j2sdk.
In win98 you might need to add an entry in the autoexec.bat like this:
doskey
set path=c:\progra~1\j2sdk1~1.1_0\bin\
In windows 2000 you need to add a system variable (look this up in the
control panel) and make an entry for JAVA_HOME which should have value
which is the installation directory of your j2sdk.
In linux, depending on your distro this might differ. After installing
j2sdk, try executing java, javac, appletviewer and jar (without giving
the absolute path). If it can't be
executed, we might be forced to include a soft link (ie a shortcut) to
these executables to a system directory like /usr/bin (works in
Mandrake and other distro where you can run all executables in /usr/bin
without including the path). Read on
javaSetup.sh in the scripts folder (included in any Java
applet/application download in my gallery)
on directions on how this can be
done.
*Java and all Java-related trademarks and logos are trademarks or
registered trademarks of Sun Microsystems, Inc. in the U.S., other
countries or both. Sun has not authorized, sponsored, endorsed, or
approved this document and is not responsible for its content.
|