up vote 0 down vote favorite
share [g+] share [fb]

I am trying to install java on linux(red hat) server using ssh.

I am using wget command to download it.At time of download it will be downloaded as file name

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

but when i fire command to install it,generates error

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

I am new with linux os. Please tell how can i install java and run it on Linux server using ssh.

Thanks in advance

link|improve this question
not ssh-related. – quack quixote Oct 13 '09 at 12:03
feedback

migrated from stackoverflow.com Oct 13 '09 at 11:42

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

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
link|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
feedback

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.

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

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

link|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 – TuxGeek Oct 13 '09 at 11:30
feedback

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.

link|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
feedback
  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).
link|improve this answer
feedback

Your Answer

 
or
required, but never shown

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