Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP


jdk-6u31-linux-i586.bin: invalid number of bytes #18

josvazg opened this Issue · 11 comments

13 participants

josvazg Jessie Evangelista Ivan Lyapunov Jon Mort Marius P Leandro José Ventura Silva Janusz Dziemidowicz Mikko Rantalainen Lowe Thiderman Miah Johnson Martin Polden Rob Coon Martin Wimpress

The repository building process fails with this message:
[x] Installing Java build requirements success
[x] Making build directories success
[x] Removing clones of success
[x] Cloning success
[x] Checking out v6.31-1 success
[x] Getting Java SE download pagesuccess
[x] Getting current release download page success
[x] Downloading jdk-6u31-linux-i586.bin : 81.34 MB success
[x] Symlinking jdk-6u31-linux-i586.bin success
[x] Downloading jdk-6u31-linux-x64.bin : 81.62 MB success
[x] Symlinking jdk-6u31-linux-x64.bin success
[x] Updating the changelog success
[x] Building the packages success
ERROR! Packages failed to build. Please raise an issue with the upstream script developer -

The last lines of the log are:

rm -rf jdk1.6.0_31
binsize=$(wc -c jdk-6u31-linux-i586.bin | awk '{print $1}'); \
zipstart=$(unzip -ql jdk-6u31-linux-i586.bin 2>&1 >/dev/null | sed -n -e 's/.* ([0-9][0-9]) extra bytes./\1/p'); \
tail -c $(expr $binsize - $zipstart) jdk-6u31-linux-i586.bin >
expr: syntax error
tail: jdk-6u31-linux-i586.bin: invalid number of bytes
make: *** [unpack-i586-stamp] Error 1
dpkg-buildpackage: fallo: debian/rules build devolvió un estado de salida de error 2
30810's retcode: 2

Jessie Evangelista

+1 on this issue.

I mean I also encountered it trying to install java on a fresh VM

Ivan Lyapunov

+1 issue. please fix

Jon Mort

The problem is that oracle prevents direct download of the .bin file. The download page now redirects to because of a missing cookie. Oracle is forcing users to accept the EULA.

 [x] Downloading jdk-6u31-linux-i586.bin : 81.34 MB   --2012-03-27 12:53:58--
Connecting to||:80... connected.
HTTP request sent, awaiting response... 302 Moved Temporarily
Location: [following]
--2012-03-27 12:53:58--
Connecting to||:443... connected.
HTTP request sent, awaiting response... 302 Moved Temporarily
Location: [following]
--2012-03-27 12:53:59--
Connecting to||:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 5307 (5.2K) [text/html]
Saving to: `/var/local/oab/pkg/jdk-6u31-linux-i586.bin'
Marius P


Leandro José Ventura Silva

Hi, while this isn't solved I did the following:
1. Downloaded the jdk-6u31-linux-i586.bin and jdk-6u31-linux-x64.bin from Oracle.
2. Moved these two files to /var/local/oab/pkg/
3. At line 295 of the script
wget -c "${DOWNLOAD_URL}" -O /var/local/oab/pkg/${JAVA_BIN} >> "$log" 2>&1 &
I just commented this line and executed the script.

Obviously its not the best solution. But solves the problem if you can't wait the good solution...

Janusz Dziemidowicz

For the last few days people are reporting this exact problem on my project due to a message that suggests them to do so.
I don't believe any automated download of Java packages will work as Oracle really doesn't like it. I'd recommend at least adding checksum validation to be sure the files were downloaded successfully.

Mikko Rantalainen

It seems that it's possible to download *.bin files via "" directly without cookies or javascript. Unfortunately, the URLs do not make any sense so one needs to parse the HTML to locate the correct label and then proceed to fetch the file.

For example, link "Linux (self-extracting file)" points to "" which will emit the correct contents for jre-6u31-linux-i586.bin (or at least that binary is self-extracing sh script). It might be doable to search for

<a title=" Download Java software for Linux (self-extracting file)" href="(.*?)"


<a title=" Download Java software for Linux x64" href="(.*?)"

to extract download URLs from the URL "".

Lowe Thiderman

+1 for this as well

Miah Johnson

I spent a bit of time on the Oracle site last night and looked at the problem.

You can grab the file like so:

curl -OL -b "oraclelicensejdk-6u31-oth-JPR=accept-securebackup-cookie;gpw_e24=" ''

Martin Polden

Fixed in this pull request: #20

Rob Coon

As of version 26, this is happening again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.