Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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


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.

share|improve this question

migrated from Oct 13 '09 at 11:42

This question came from our site for professional and enthusiast programmers.

not ssh-related. – quack quixote Oct 13 '09 at 12:03
up vote 2 down vote accepted

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:

share|improve this answer
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"; is another way to get it right the first time. – esm Nov 13 '09 at 15:42

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 and for this kind of questions.

share|improve this answer
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 '09 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. – quack quixote Oct 13 '09 at 12:26

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.

share|improve this answer
Yes, I guess its a problem of file execution. – ukanth Oct 13 '09 at 11:29

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

share|improve this answer
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 '09 at 11:30
  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).
share|improve this answer

You must log in to answer this question.

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