0

I am trying to install Java on Red Hat Linux through SSH.

I am using wget to download the installer. When wget downloads the file, it saves it with a filename of

jre-6u16-linux-i586-rpm.bin?e=1255431454245&h=f50f4cda5641e55f8e49f217e854faca%2F&filename=jre-6u16-linux-i586-rpm.bin

But, when I try to execute the file to install it, it throws this error

cannot access `jre-6u16-linux-i586-rpm.bin?e=1255431454245': No such file or directory

I am new to Linux. Please explain how to install Java on Linux through the terminal.

1

5 Answers 5

2

First and foremost make sure the file is not the webpage, the Linux jre6u16 is roughly 19mb. The ampersand (&) in the filename as already stated, tells the OS to run the process in the background. Rename the file to something simpler using mv and put the filename in quotes:

mv "jre-6u16-linux-i586-rpm.bin?e=1255431454245&h=f50f4cda5641e55f8e49f217e854faca%2F&filename=jre-6u16-linux-i586-rpm.bin" jre-6u16-linux-i586-rpm.bin

then allow execute permissions:

chmod a+x jre-6u16-linux-i586-rpm.bin

then we can install it:

./jre-6u16-linux-i586-rpm.bin
1
  • Protip: while wget doesn't typically get the filename right when grabbing URLs with arguments, lftpget and curl usually do the right thing and save the file with the correct name. Also, "wget -O blah.rpm host.name/url/path/blah.rpm" is another way to get it right the first time.
    – esm
    Nov 13, 2009 at 15:42
2

How big is this file (ls -lh jre*)? To me, it looks like you've downloaded Sun's download page instead of the installer.

Additionally, there is no such thing as a "Linux OS". (Linux is the kernel, try to become familiar with the terminology!) If your looking for answers, try searching (aka googling) for your distribution name, e.g. "ubuntu java installation" or "suse java installation". You may also try to include your version for even better results, e.g. "karmic java installation".

And finally, you should consider serverfault.com and superuser.com for this kind of questions.

2
  • You are spot on with the "To me, it looks like you've downloaded Sun's download page instead of the installer.part" +1
    – Amit
    Oct 13, 2009 at 11:29
  • wget does that for this kind of download page when the download url goes through a script. you'd need to specify -O filename to save it to filename. looking at the size as the answer suggests will help you figure out if it got the file you expected. Oct 13, 2009 at 12:26
1

What Linux distribution are you using? Most of them should allow you to install Java through their package management system (such as APT for Debian and Ubuntu), which is easier, and allows for easy updates as well.

If you really must install it manually, start by renaming the file to something shorter and then make it executable with this command:

chmod a+x filename

Then you should be able to run it.

1
  • Yes, I guess its a problem of file execution.
    – ukanth
    Oct 13, 2009 at 11:29
1

you probably had to put quotes around when you ran wget.

rename the file like this

mv 'jre-6u16-linux-i586-rpm.bin?e=1255431454245&h=f50f4cda5641e55f8e49f217e854faca%2F&filename=jre-6u16-linux-i586-rpm.bin' jre-6u16-linux-i586-rpm.bin

then install it

1
  • Rename it as gnibbler suggest and make it as executable by chmod +x jre-6u16-linux-i586-rpm.bin and use ./jre-6u16-linux-i586-rpm.bin to install it
    – ukanth
    Oct 13, 2009 at 11:30
0
  1. Not really programing related,
  2. Use quotes around file name (jre-6u....). That ampersand "&" in downloaded file name has special meaning (run process in background)
  3. Depending on you linux distro there should be better way (distribution specyfic that takes care of all process and updates).

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .