Ubuntu – Can’t install sun-java6-jre in server

javaserverssh

I'm extremely new to linux and wanted to run a server but the program want to run requires linux.

Im trying to run this command via ssh to my server but receive this every time.

sudo apt-get install sun-java6-bin sun-java6-jdk sun-java6-jre

But I reccieve this.

user@serverubuntu:~$ sudo apt-get install sun-java6-bin sun-java6-jdk sun-java6-jre
[sudo] password for user: 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package sun-java6-jre is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

Package sun-java6-jdk is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

Package sun-java6-bin is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'sun-java6-bin' has no installation candidate
E: Package 'sun-java6-jdk' has no installation candidate
E: Package 'sun-java6-jre' has no installation candidate
user@serverubuntu:~$ sudo apt-get install sun-java7-bin sun-java7-jdk sun-java7-jre
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package sun-java7-bin
E: Unable to locate package sun-java7-jdk
E: Unable to locate package sun-java7-jre
user@serverubuntu:~$

Sorry Im extremely new to linux and dont know how to do much.

Thanks 🙂

Best Answer

The official java packages has been removed from the Ubuntu repositories. You can install open-jdk instead:

sudo apt-get install openjdk-7-jdk

If you need the real thing you need to install the oracle java package:

sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java7-installer