Commit | Line | Data |
d50cb536 |
1 | |
2 | This archive contains the following files: |
3 | README - the README file which explains how to use this program (this file) |
4 | get_jdk.pl - the program to download JDK |
5 | jdk_hosts - the descriptor file required by the program |
6 | |
7 | Nate Patwardhan (nvp@oreilly.com) wrote get_jdk.pl to automate the |
8 | download of JDK (Java Development Kit) from a distribution site based |
9 | on your Unix flavor. This program is based on some of the examples |
10 | found in the LWP cookbook that was included with your LWP distribution. |
11 | |
12 | Current Unix flavors that appear in the descriptor file (more |
13 | suggestions from Beta testers will be welcomed): |
14 | Solaris |
15 | Linux |
16 | FreeBSD |
17 | |
18 | To use get_jdk.pl properly, you *must* have LWP (libwww) and its |
19 | dependencies installed. Once you've installed LWP, you should be able |
20 | to use this module without any problems on any Unix flavor. |
21 | |
22 | By default, get_jdk.pl uses #!/usr/local/bin/perl in its shebang path, |
23 | so you may have to execute get_jdk.pl like: |
24 | |
25 | perl get_jdk.pl |
26 | |
27 | -OR- |
28 | |
29 | perl5 get_jdk.pl |
30 | |
31 | based on your site's Perl installation. |
32 | |
33 | get_jdk.pl reads the $^O to determine what Unix flavor you're using, |
34 | and compares the value of $^O to the first field shown in the |
35 | descriptor file, jdk_hosts. For example, $^O for Solaris versions of |
36 | Perl is: 'solaris'; Solaris is represented in the descriptor file |
37 | like: |
38 | |
39 | solaris=>ftp://ftp.javasoft.com/pub/jdk1.1/jdk1.1.3-solaris2-sparc.bin |
40 | |
41 | When get_jdk.pl reads the descriptor file, it splits the fields on |
42 | '=>', and reads them into a hash, %HOSTS. get_jdk.pl then compares |
43 | the value of $^O to $HOSTS{'osname'}, and returns the address of the |
44 | JDK distribution site if $^O eq $HOSTS{'osname'}. If there is not a |
45 | match, get_jdk.pl fails. |
46 | |
47 | get_jdk.pl represents the hostname of distribution sites in URL |
48 | format: protocol://hostname.some.com/path/filename.extension |
49 | When a URL is found, get_jdk.pl parses out the filename; this is |
50 | significant, because the output from the remote host is directed to |
51 | the file parsed from the URL. |
52 | |
53 | When you execute get_jdk.pl, you'll know it's working correctly if it |
54 | outputs something like: |
55 | |
56 | A JDK port for your OS has been found. |
57 | Contacting: |
58 | ftp://ftp.javasoft.com/pub/jdk1.1/jdk1.1.3-solaris2-sparc.bin |
59 | Attempting to download: jdk1.1.3-solaris2-sparc.bin |
60 | 0% - 1460 bytes received |
61 | 0% - 4380 bytes received |
62 | 0% - 7300 bytes received |
63 | 0% - 8192 bytes received |
64 | [etc etc etc until you reach 100%] |
65 | |
66 | Future (PRK release) versions of get_jdk.pl will allow the user to |
67 | update the descriptor file from the ora.com (oreilly.com) FTP/WWW |
68 | site. This version does not support the -update flag. |
69 | |
70 | Happy JDK'ing! :-) |
71 | |
72 | -- |
73 | Nate Patwardhan |
74 | nvp@oreilly.com |