2013-11-06

Slitaz -- JRE

get-java6-jre
Could not download jre.bin. Exiting.

# wget --no-cookies --no-check-certificate --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com" "http://download.oracle.com/otn-pub/java/jdk/6u45-b06/jre-6u45-linux-i586.bin"

JDK 6u45
http://download.oracle.com/otn-pub/java/jdk/6u45-b06/jdk-6u45-linux-i586.bin
JRE 6u45
http://download.oracle.com/otn-pub/java/jdk/6u45-b06/jre-6u45-linux-i586.bin

JDK 7u25
    http://download.oracle.com/otn-pub/java/jdk/7u25-b15/jdk-7u25-linux-i586.tar.gz
JRE 7u25
    http://download.oracle.com/otn-pub/java/jdk/7u25-b15/jre-7u25-linux-i586.tar.gz
JDK 7u45
    http://download.oracle.com/otn-pub/java/jdk/7u45-b18/jdk-7u45-linux-i586.tar.gz


1.
# wget --no-cookies --no-check-certificate --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com" "http://download.oracle.com/otn-pub/java/jdk/6u45-b06/jre-6u45-linux-i586.bin"

# curl -L -O -k -H "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com" "http://download.oracle.com/otn-pub/java/jdk/6u45-b06/jdk-6u45-linux-i586.bin"

root@slitaz:/home/tux# curl -L -O -k -H "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com" "http://download.oracle.com/otn-pub/java/jdk/6u45-b06/jdk-6u45-linux-i586.bin"
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
  0     0    0   286    0     0    347      0 --:--:-- --:--:-- --:--:--   347
100 68.4M  100 68.4M    0     0  3715k      0  0:00:18  0:00:18 --:--:-- 3167k
root@slitaz:/home/tux#

 -H, --header LINE   Custom header to pass to server (H)
 -k, --insecure      Allow connections to SSL sites without certs (H)
 -L, --location      Follow redirects (H)
 -o, --output FILE   Write output to <file> instead of stdout
 -O, --remote-name   Write output to a file named as the remote file
     --remote-name-all Use the remote file name for all URLs


2.
root@slitaz:/home/tux# java -version
java version "1.6.0_45"
Java(TM) SE Runtime Environment (build 1.6.0_45-b06)
Java HotSpot(TM) Server VM (build 20.45-b01, mixed mode)


3.
http://mirror.slitaz.org/packages/cooking/get-java6-jre-1.1.0.tazpkg

root@slitaz:/home/tux# diff /usr/bin/get-java6-jre-1.1.0 /usr/bin/get-java6-jre
--- /usr/bin/get-java6-jre-1.1.0
+++ /usr/bin/get-java6-jre
@@ -6,15 +6,15 @@
 # Author : Eric Joseph-Alexandre <erjo@slitaz.org>

 PACKAGE="java6-jre"
-WEB_SITE="http://www.java.com/"
+WEB_SITE="http://download.oracle.com/otn-pub/java/jdk/"
 SHORT_DESC="SUN Java Runtime."
 DEPENDS="xorg-libXtst"
 TARBALL="jre.bin"
 TEMP_DIR="/tmp/$PACKAGE.$$"
 ROOT="$1"

-URL="$(wget -O - ${WEB_SITE}en/download/manual_v6.jsp | \
-       sed '/self-extracting/!d;s/.*href="\([^"]*\).*/\1/;q')"
+# URL="$(wget -O - ${WEB_SITE}en/download/manual_v6.jsp | \
+#       sed '/self-extracting/!d;s/.*href="\([^"]*\).*/\1/;q')"

 # Check if we are root starting anything
 if test $(id -u) != 0 ; then
@@ -36,8 +36,12 @@
 test -d $TEMP_DIR || mkdir $TEMP_DIR
 cd $TEMP_DIR

+# FIXME. http://download.oracle.com/otn-pub/java/jdk/6u45-b06/jre-6u45-linux-i586.bin
+URL="$(wget --no-cookies --no-check-certificate --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F" -O $TARBALL ${WEB_SITE}6u45-b06/jre-6u45-linux-i586.bin)"
+
 # Download the file
-test -f $TARBALL || wget $URL -O $TARBALL
+# test -f $TARBALL || wget $URL -O $TARBALL
+test -f $TARBALL || $URL
 if [ ! -f $TARBALL ]; then
     cd $CUR_DIR
     rm -rf $TEMP_DIR
root@slitaz:/home/tux#


4.
wok - Searching for 'java'
http://hg.slitaz.org/wok/log?rev=java

age     author     description
2 days ago     Dominique Corbex     get-LibreOffice: mv java from DEPS to SUGGESTED
8 weeks ago     Pascal Bellard     Add some licenses
8 weeks ago     Pascal Bellard     get-*: add license
2 months ago     Pascal Bellard     Add some GPL2 licenses
3 months ago     Pascal Bellard     *vnc*: add LICENSE
3 months ago     Eric Joseph-Alexandre     Add: tightvnc-java
10 months ago     Pascal Bellard     Update get-java6-jre (again)
10 months ago     Pascal Bellard     Update get-java6-jre (thanks ernia)
17 months ago     Richard Dunbar     get-java6-jre: fix generic with tar
17 months ago     Richard Dunbar     get-java6-jre: update tarball


Ref:
http://www.oracle.com/technetwork/java/javase/terms/license/index.html
http://stackoverflow.com/questions/10268583/how-to-automate-download-and-instalation-of-java-jdk-on-linux