Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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.

share|improve this question

migrated from stackoverflow.com 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
add comment

5 Answers

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:

./jre-6u16-linux-i586-rpm.bin
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 host.name/url/path/blah.rpm"; is another way to get it right the first time. –  esm Nov 13 '09 at 15:42
add comment

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
add comment

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
add comment

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.

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
add comment
  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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.