How to install Java on Ubuntu through SSH?

11,115

Solution 1

Use sudo apt-get install <package name> command

Here is the list of Java packages for Ubuntu 9.10 - http://www.ubuntugeek.com/install-java-runtime-environment-jre-in-ubuntu-9-10-karmic.html

Solution 2

You can use wget from ssh to download a specific file, you can use

scp myfile user@host:/path/on/remote/host

To copy a file over.

From ssh do

scp user@original_host:/path/to/file . 

To copy a file from a computer to the cwd

Unless you need a specific java version I'd go with

sudo aptitude install sun-java6-jre
Share:
11,115

Related videos on Youtube

Admin
Author by

Admin

Updated on September 17, 2022

Comments

  • Admin
    Admin over 1 year

    In short, all of the installation guides assume that I have a way to download the Java binary. Being clueless, I do not know how to do this.

    I'm using Ubuntu 9.10-x86_64

    • Admin
      Admin over 13 years
      but you want to SCP the installer and install it?
    • Admin
      Admin over 13 years
      @Nishant SCP is just another pile of confusion right now. I'd rather not.
  • Admin
    Admin over 13 years
    E: Couldn't find package sun-java6-jre What did I do wrong?
  • Admin
    Admin over 13 years
    +1 for mentioning wget and copy over ssh. I prefer rsync, but that will work as well :)
  • Admin
    Admin over 13 years
    I can't use any sort of browser to get the files.
  • Elalfer
    Elalfer over 13 years
    try to do sudo apt-get update first to update the list of packets. You can also do sudo apt-cache search java to find out the list of packets with the word java in the name or description
  • Admin
    Admin over 13 years
    once again my cluelessness proves fatal. Can I use SCP to grab the file from the website or will I need to put it somewhere acessible? Also: aptitude: command not found
  • Stephen C
    Stephen C over 13 years
    @Bacu - 'man' is your friend.
  • Stephen C
    Stephen C over 13 years
    @Bacu - Why is that?
  • Admin
    Admin over 13 years
    I managed to do it with wget. Wonderful.
  • user2989902
    user2989902 over 13 years
    @Bacu - Current versions of Ubuntu no longer have aptitude installed by default, either use apt-get or install aptitude with "apt-get install aptitude"