I'm normally a windows user and I am currently using PuTTY to connect to a headless linux box that is running Fedora 8. I need to download the latest JDK and install it but I have to do it using the command line.
How can I do this?
This is why it is a good idea to install lynx on headless servers, and learn how to use lynx as well. This provides you with text-mode web browsing through a shell prompt, including the ability to download files. Because lynx is often used as the basis for web browsing for blind people, most websites do make an effort to support it.
Lynx would allow you to go to http://www.sun.com, browse to the Java download page, select what you want and download it.
Alternatively, you could download what you need onto your Windows workstation, then use pscp.exe (the scp that comes with Putty) to copy it through the ssh link to the server. That might be the easiest way to handle your particular situation today. If you want a graphical SCP client, then have a look at WinSCP.
You can grab a link to the download from http://java.sun.com/javase/downloads/index.jsp you need to progress through Sun's download page until you reach the actual link to the download, e.g cds.sun.com/is-bin/INTERSHOP.enfinity/WFS/CDS-CDS_Developer-Site/en_US/-/USD/VerifyItem-Start/jdk-6u16-linux-i586.bin?BundledLineItemUUID=p5xIBe.psLUAAAEkDw4ek212&OrderID=aAtIBe.pOx4AAAEkAg4ek212&ProductID=Dx1IBe.prBgAAAEirRcTvuC_&FileName=/jdk-6u16-linux-i586.bin.
Now in your shell just type 'wget ' followed by the url. once its downloaded, execute 'sh jdk-6u16-linux-i586.bin' and run through the installer.
For setting up Java tools on Fedora systems, I highly recommend using http://www.jpackage.org/, which will give you an RPM of the JDK you can install.
Have you tried using the CLI package manager?
For Fedora this is
yum used as such:
yum search *pattern*
yum install *program*
This works for me - directly from the server:
wget -H --follow-ftp -r http://cds.sun.com/is-bin/INTERSHOP.enfinity/WFS/CDS-CDS_Developer-Site/en_US/-/USD/VerifyItem-Start/sges-2_1_1-linux.bin?BundledLineItemUUID=KwFIBe.oLm0AAAEmpBwE680I&OrderID=aupIBe.oEnAAAAEmlBwE680I&ProductID=dc5IBe.olfwAAAEkB7xn4X5b&FileName=/sges-2_1_1-linux.bin