Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 57739 - Java (J2SDK) install fails with error about the file being corrupted
Summary: Java (J2SDK) install fails with error about the file being corrupted
Status: RESOLVED UPSTREAM
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Development (show other bugs)
Hardware: x86 Linux
: High normal (vote)
Assignee: Java team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-07-20 08:35 UTC by Russ Tennant
Modified: 2004-07-23 15:17 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Russ Tennant 2004-07-20 08:35:00 UTC
Attempting to install j2sdk-1_4_2_05-linux-i586.bin fails with the following message. This output is not from an ebuild, but from installing the newest version manually.

[output]

Do you agree to the above license terms? [yes or no]
yes
tail: `-1' option is obsolete; use `-n 1' since this will be removed in the future
Unpacking...
tail: cannot open `+486' for reading: No such file or directory
Checksumming...
1
The download file appears to be corrupted.  Please refer
to the Troubleshooting section of the Installation
Instructions on the download page for more information.
Please do not attempt to install this archive file.

[end output]

The file is not corrupted. This happens on several machines that I tried. Some machines that it did work on (haven't been updated in a while) have a different version of coreutils installed. 

On the machines it did install, the version of coreutils is 5.0.91-r4. On the machines it failed to install, the version of coreutils is  5.2.1. 


I could get the package to install if I changed the following line (#358) in j2sdk-1_4_2_05-linux-i586.bin

FROM:
  if expr $sum1 != 27530 || expr $sum2 != 35512  ....
TO:
  if [ $sum1 -ne 27530 || $sum2 -ne 35512 ] ....

Also, I appended "-n" to all tail commands.


Reproducible: Always
Steps to Reproduce:
1. Download java 2 sdk version 1.4.2_05 (.bin)
2. Install on an up to date gentoo box.
   # sh j2sdk-1_4_2_05-linux-i586.bin

Actual Results:  
[Snipped out license]
Do you agree to the above license terms? [yes or no]
yes
tail: `-1' option is obsolete; use `-n 1' since this will be removed in the future
Unpacking...
tail: cannot open `+486' for reading: No such file or directory
Checksumming...
1
The download file appears to be corrupted.  Please refer
to the Troubleshooting section of the Installation
Instructions on the download page for more information.
Please do not attempt to install this archive file.
Comment 1 Thomas Matthijs (RETIRED) gentoo-dev 2004-07-20 09:56:59 UTC
Why install it directly?
when we have an ebuild that should always work

emerge sun-jdk
Comment 2 Russ Tennant 2004-07-20 10:15:40 UTC
We do use the ebuilds for jdk on some machines, but most installations are handled manually. It is easier for us to maintain a few java applications ourselves than to try and maintain updates to the jdk, tomcat, jython, etc. Traditionally the tomcat, jython, and jdk ebuilds have not worked for us for one reason or another. It just isn't worth the hassle to try and maintain our software with the ebuilds at this point. In the future, that will probably change but now it isn't a possibility. 

For this particular instance, I needed to install the newest version (1.4.2_05) of the jdk for testing (we need a bugfix in 1.4.2_05) and there isn't an ebuild for that anyway. Also, I do not think the jdk ebuilds are setup for me to install multiple micro versions (jdk 1.4.0, 1.4.1, and 1.4.2) at the same time. Which is something that we require also. 

Comment 3 Thomas Matthijs (RETIRED) gentoo-dev 2004-07-20 12:18:46 UTC
Whats wrong with ebuilds to maintain software? you can have your own set. and submit them to us
I know the tomcat,etc ebuilds need some work, but you could help us fix them..
If you make a bug about the jdk bugfix i'm sure we can include it in our ebuilds

Well, this isn't a java bug then, reassigning it back
Comment 4 Russ Tennant 2004-07-20 13:06:27 UTC
In the long run, we plan to use the ebuilds to maintain all the software. It is just taking time to get there and of course we will post any improvements we come up with to bugzilla.

I agree w/ you. I don't think this is a problem with the java portion of Gentoo. I think coreutils may be broken or the java installer may be broken. I'm leaning toward coreutils since it used to work with a previous version.
Comment 5 dswhite42 2004-07-21 14:20:27 UTC
I'm using J2RE instead of J2SDK, and the proposed solution to this bug ("use ebuilds, not direct downloads from Sun") doesn't apply in this case, so I'm adding these comments:

> emerge -s sun-jre-bin

*  dev-java/sun-jre-bin
      Latest version available: 1.4.2.05
      Latest version installed: 1.4.2.04
      Size of downloaded files: 14,044 kB
      Homepage:    http://java.sun.com/j2se/1.4.2/
      Description: Sun's J2SE Platform
      License:     sun-bcla-java-vm

> emerge sun-jre-bin

>>> emerge (1 of 1) dev-java/sun-jre-bin-1.4.2.05 to /
!!! j2re-1_4_2_05-linux-i586.bin not found in /usr/portage/distfiles.

!!! dev-java/sun-jre-bin-1.4.2.05 has fetch restriction turned on.
!!! This probably means that this ebuild's files must be downloaded
!!! manually.  See the comments in the ebuild for more information.

 * Please download j2re-1_4_2_05-linux-i586.bin from:
 * http://javashoplm.sun.com/ECom/docs/Welcome.jsp?StoreId=22&PartDetailId=j2re-1.4.2_05-oth-JPR&SiteId=JSC&TransactionId=noreg
 * (select the "Linux self-extracting file" package format of the JRE
 * and move it to /usr/portage/distfiles

-------------------------

So, I manually download j2re-1_4_2_05-linux-i586.bin, run the program, agree to the license, and then get this:

Do you agree to the above license terms? [yes or no]    yes
tail: `-1' option is obsolete; use `-n 1' since this will be removed in the future
Unpacking...
tail: cannot open `+479' for reading: No such file or directory
Checksumming...
1
The download file appears to be corrupted.  Please refer
to the Troubleshooting section of the Installation
Instructions on the download page for more information.
Please do not attempt to install this archive file.

-------------------------------------------------

The solution is simple: the reference to "tail -1" (line 326) should be changed to "tail -n 1" and the reference to "tail +479" (line 334) should be changed to "tail -n +479".  The J2RE archive will then run and install correctly.  (I suspect the additional problem the original poster had was that his text editor rather unhelpfully added a newline to the end of .bin file when he edited it (just like mine did, which messed up the checksumming process until I removed the extraneous newline))

How this can be fixed within the context of the ebuild system, though, I'm not sure.  I'm sure there was a good reason that the old "tail -N" and "tail +N" syntax was deprecated, then removed from /usr/bin/tail, but until other vendors like Sun start using the new syntax, does the +/- syntax need to be reinserted into "tail" in coreutils? 
Comment 6 Russ Tennant 2004-07-21 14:46:09 UTC
That's correct I used vim. Running the following solved the checksum problem.

sed -i -e "s/tail/tail -n/g" j2sdk-1_4_2_05-linux-i586.bin

I'll go ahead and submit a bug report with Sun.
Comment 7 dswhite42 2004-07-21 14:50:37 UTC
Hmmmmm.  I missed a critical line in the ebuild instructions - after I downloaded the j2re-1_4_2_05-linux-i586.bin, I was supposed to put it in /usr/portage/distfiles and rerun "emerge sun-jre-bin" rather than manually install it.  And it looks like ebuild system must use a different way to extract/install the files, since it didn't complain about "tail" syntax incompatibilties.  

So... maybe all's well in the world after all.  Except for those who want to manually install Java or for whatever reason need the old +/- syntax in "tail".  But whether or not this bug gets addressed by the coreutils folks or just closed, at least my J2RE is now installed.

(oh, I've put in a bug report with Sun already, but feel free to double-up)
Comment 8 Thomas Matthijs (RETIRED) gentoo-dev 2004-07-23 14:30:14 UTC
well, not using -n was deprecated ages ago, sun needs to fix there installer, marking it upstream, use the ebuild :)
Comment 9 Russ Tennant 2004-07-23 15:17:35 UTC
This is fixed in java 2 sdk 1.5 beta 2.

http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4980600

Workaround from bug report:
"export _POSIX2_VERSION=199209" before running the installer.

I verified the workaround does work on the Gentoo machines I was observing the problem on.