summaryrefslogtreecommitdiff
path: root/jpl/get_jdk/README
blob: 0c38ccf7fd9780a63b7565160b5feb0d1e119f6e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74

This archive contains the following files:
README - the README file which explains how to use this program (this file)
get_jdk.pl - the program to download JDK
jdk_hosts - the descriptor file required by the program

Nate Patwardhan (nvp@oreilly.com) wrote get_jdk.pl to automate the
download of JDK (Java Development Kit) from a distribution site based
on your Unix flavor.  This program is based on some of the examples
found in the LWP cookbook that was included with your LWP distribution.

Current Unix flavors that appear in the descriptor file (more
suggestions from Beta testers will be welcomed):
	Solaris
	Linux
	FreeBSD

To use get_jdk.pl properly, you *must* have LWP (libwww) and its
dependencies installed.  Once you've installed LWP, you should be able
to use this module without any problems on any Unix flavor.

By default, get_jdk.pl uses #!/usr/local/bin/perl in its shebang path,
so you may have to execute get_jdk.pl like:

	perl get_jdk.pl

-OR-

	perl5 get_jdk.pl

based on your site's Perl installation.

get_jdk.pl reads the $^O to determine what Unix flavor you're using,
and compares the value of $^O to the first field shown in the
descriptor file, jdk_hosts.  For example, $^O for Solaris versions of
Perl is: 'solaris'; Solaris is represented in the descriptor file
like:

	solaris=>ftp://ftp.javasoft.com/pub/jdk1.1/jdk1.1.3-solaris2-sparc.bin

When get_jdk.pl reads the descriptor file, it splits the fields on
'=>', and reads them into a hash, %HOSTS.  get_jdk.pl then compares
the value of $^O to $HOSTS{'osname'}, and returns the address of the
JDK distribution site if $^O eq $HOSTS{'osname'}.  If there is not a
match, get_jdk.pl fails.

get_jdk.pl represents the hostname of distribution sites in URL
format: protocol://hostname.some.com/path/filename.extension  
When a URL is found, get_jdk.pl parses out the filename; this is
significant, because the output from the remote host is directed to
the file parsed from the URL.

When you execute get_jdk.pl, you'll know it's working correctly if it
outputs something like:

	A JDK port for your OS has been found.
	Contacting:
	ftp://ftp.javasoft.com/pub/jdk1.1/jdk1.1.3-solaris2-sparc.bin
	Attempting to download: jdk1.1.3-solaris2-sparc.bin
	0% - 1460 bytes received
	0% - 4380 bytes received
	0% - 7300 bytes received
	0% - 8192 bytes received
	[etc etc etc until you reach 100%]

Future (PRK release) versions of get_jdk.pl will allow the user to
update the descriptor file from the ora.com (oreilly.com) FTP/WWW
site.  This version does not support the -update flag.

Happy JDK'ing!  :-)

--
Nate Patwardhan
nvp@oreilly.com