TITLE:		Installing the Java SDK

LFS VERSION:	3.3

AUTHOR:		timothy bauscher <timothy@linuxfromscratch.org>

SYNOPSIS:	This hint describes the installation of
		the Java Software Development Kit.

HINT:


INTRODUCTION
============

Sun's Java Software Development Kit is a proprietary software
package used to develop and run applications written in the
Java programming language.

This hint describes the process of installing a binary version
of the Java Software Development Kit. Should you wish to install
from source instead, I encourage you to read the Java From Scratch
hint.

This hint assumes that you are logged in as root. The SDK will
be installed in the /opt directory. Paths will be appended to
your ~/.bash_profile file.


DOWNLOAD
========

http://java.sun.com/j2se/1.3/download.html

or

http://java.sun.com/j2se/1.4/download.html


DEPENDENCIES
============

You must have libstdc++-libc6.1-1.so.2 installed in /usr/lib/ before
you may run the programs in the SDK. There are three installation
options:

A. Create a symbolic link to a similar library

	ln -s /usr/lib/libstdc++-3-*.so \
		/usr/lib/libstdc++-libc6.1-1.so.2

B. Compile the library yourself

	(not documented here)

C. Download the library in binary format

	http://www.linuxfromscratch.org/~timothy/misc/libstdc++-libc6.1-1.so.2

	Thanks go out to conathan for providing this binary library.


INSTALL
=======

Change to the directory where the SDK was downloaded. Then,
type the following:

	mv j2sdk*.bin /opt &&
	cd /opt &&
	chmod a+x j2sdk*.bin &&
	./j2sdk*.bin

The large installation file may now be removed.

	rm j2sdk*.bin

Let us rename the directory now.

	mv j2sdk* j2sdk

Login to a user account.

	su - <USER_NAME>


PATHS
=====

Type the following, so that your PATH and MANPATH point to the SDK:

cat >> ~/.bash_profile << "EOF"

PATH=$PATH:/opt/j2sdk/bin
MANPATH=$MANPATH:/opt/j2sdk/man/man1

export PATH MANPATH

EOF
source ~/.bash_profile


TEST
====

To make sure the SDK is working, we write a test program:

cat > Testing.java << "EOF"

public class Testing {

public static void main (String[] args) {
System.out.println("I love Java!");
}

}
EOF

Compile and run Testing.java by typing:

	javac Testing.java &&
	java Testing


LICENSES
========

You may copy, modify, redistribute, and sell this hint on
any media. The author cannot be held liable for anything
even remotely related to this hint.

The SDK is distributed under its own proprietary license.
