2

I am using ubuntu 14.04 version, 64 bit. when I give java -version in terminal, I get :

java version "1.7.0_65"
OpenJDK Runtime Environment (IcedTea 2.5.3) (7u71-2.5.3-0ubuntu0.14.04.1) 
OpenJDK 64-Bit Server VM (build 24.65-b04, mixed mode)

So I have jdk version 1.7.0_65 already running in my system. How can I update to jdk version 1.7.0_80?

Please give instructions in detail.. step by step..

Note : Am not able to use ppa. When I give sudo add-apt-repository ppa:webupd8team/java, it gives an error :

gpg: requesting key EEA14886 from hkp server keyserver.ubuntu.com
gpg: keyserver timed out
gpg: keyserver receive failed: keyserver error

Is there any other way to update jdk without using ppa?

echo $PATH

/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/loc‌​al/games:/usr/local/go/bin

apt-cache policy openjdk-7-jdk

openjdk-7-jdk:
  Installed: 7u71-2.5.3-0ubuntu0.14.04.1
  Candidate: 7u79-2.5.5-0ubuntu0.14.04.2
  Version table:
     7u79-2.5.5-0ubuntu0.14.04.2 0
        500 http://in.archive.ubuntu.com/ubuntu/ trusty-updates/main amd64 Packages
        500 http://security.ubuntu.com/ubuntu/ trusty-security/main amd64 Packages
 *** 7u71-2.5.3-0ubuntu0.14.04.1 0
        100 /var/lib/dpkg/status
     7u51-2.4.6-1ubuntu4 0
        500 http://in.archive.ubuntu.com/ubuntu/ trusty/main amd64 Packages

sudo apt-get install openjdk-7-jdk

Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  golang-doc golang-go golang-go-linux-amd64 golang-src
Use 'apt-get autoremove' to remove them.
The following extra packages will be installed:
  openjdk-7-jre openjdk-7-jre-headless
Suggested packages:
  openjdk-7-demo openjdk-7-source visualvm icedtea-7-plugin
  icedtea-7-jre-jamvm sun-java6-fonts fonts-ipafont-gothic
  fonts-ipafont-mincho ttf-wqy-microhei ttf-wqy-zenhei ttf-telugu-fonts
  ttf-oriya-fonts ttf-kannada-fonts ttf-bengali-fonts
The following packages will be upgraded:
  openjdk-7-jdk openjdk-7-jre openjdk-7-jre-headless
3 upgraded, 0 newly installed, 0 to remove and 521 not upgraded.
Need to get 55.8 MB of archives.
After this operation, 220 kB disk space will be freed.
Do you want to continue? [Y/n] Y
Err http://in.archive.ubuntu.com/ubuntu/ trusty-updates/main openjdk-7-jdk amd64 7u79-2.5.5-0ubuntu0.14.04.2
  Could not connect to 192.168.5.100:80 (192.168.5.100), connection timed out
0% [Connecting to 192.168.5.100 (192.168.5.100)]
Err http://security.ubuntu.com/ubuntu/ trusty-security/main openjdk-7-jdk amd64 7u79-2.5.5-0ubuntu0.14.04.2
  Could not connect to 192.168.5.100:80 (192.168.5.100), connection timed out
Err http://security.ubuntu.com/ubuntu/ trusty-security/main openjdk-7-jre amd64 7u79-2.5.5-0ubuntu0.14.04.2
  Unable to connect to 192.168.5.100:80:
Err http://security.ubuntu.com/ubuntu/ trusty-security/main openjdk-7-jre-headless amd64 7u79-2.5.5-0ubuntu0.14.04.2
  Unable to connect to 192.168.5.100:80:
E: Failed to fetch http://security.ubuntu.com/ubuntu/pool/main/o/openjdk-7/openjdk-7-jdk_7u79-2.5.5-0ubuntu0.14.04.2_amd64.deb  Could not connect to 192.168.5.100:80 (192.168.5.100), connection timed out

E: Failed to fetch http://security.ubuntu.com/ubuntu/pool/main/o/openjdk-7/openjdk-7-jre_7u79-2.5.5-0ubuntu0.14.04.2_amd64.deb  Unable to connect to 192.168.5.100:80:

E: Failed to fetch http://security.ubuntu.com/ubuntu/pool/main/o/openjdk-7/openjdk-7-jre-headless_7u79-2.5.5-0ubuntu0.14.04.2_amd64.deb  Unable to connect to 192.168.5.100:80:

E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
anjana-pt443@anjana-pt443:~$ 
anjana-pt443@anjana-pt443:~$ java -version
java version "1.7.0_65"
OpenJDK Runtime Environment (IcedTea 2.5.3) (7u71-2.5.3-0ubuntu0.14.04.1)
OpenJDK 64-Bit Server VM (build 24.65-b04, mixed mode)

ifconfig :

eth0      Link encap:Ethernet  HWaddr d4:be:d9:67:c1:99  
          inet addr:192.168.225.34  Bcast:192.168.225.255  Mask:255.255.254.0
          inet6 addr: fe80::d6be:d9ff:fe67:c199/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:786519 errors:0 dropped:0 overruns:0 frame:0
          TX packets:156280 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:1007030240 (1.0 GB)  TX bytes:27039436 (27.0 MB)
          Interrupt:20 Memory:e6700000-e6720000 

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:14728 errors:0 dropped:0 overruns:0 frame:0
          TX packets:14728 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:2510995 (2.5 MB)  TX bytes:2510995 (2.5 MB)

cat /etc/hosts

127.0.0.1 localhost

# The following lines are desirable for IPv6 capable hosts 
::1 ip6-localhost ip6-loopback 
fe00::0 ip6-localnet 
ff00::0 ip6-mcastprefix 
ff02::1 ip6-allnodes 
ff02::2 ip6-allrouters
7
  • output of echo $PATH /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/local/go/bin
    – Anjana
    Jul 7, 2015 at 10:15
  • You have 521 not upgraded packages? Shame on you! When you ran sudo apt-get update and sudo apt-get dist-upgrade as suggested by @A.B., did you also get network errors like those the sudo apt-get install openjdk-7-jdk showed? Do you have internet access? Can you browse websites? If no, can you ping google.com? If no, can you ping 8.8.8.8?
    – Byte Commander
    Jul 7, 2015 at 10:43
  • Am not able to ping google.com and 8.8.8.8; but i can browse websites and i have internet access.
    – Anjana
    Jul 7, 2015 at 10:56
  • Add the output of cat /etc/hosts
    – A.B.
    Jul 7, 2015 at 10:57
  • # The following lines are desirable for IPv6 capable hosts ::1 ip6-localhost ip6-loopback fe00::0 ip6-localnet ff00::0 ip6-mcastprefix ff02::1 ip6-allnodes ff02::2 ip6-allrouters
    – Anjana
    Jul 7, 2015 at 10:59

3 Answers 3

1

Slightly at odds with A.B. the latest version of openjdk-7-jdk is 7u79-2.5.5-0ubuntu0.14.04.2, but your Apt output shows serious network issues:

Could not connect to 192.168.5.100:80 (192.168.5.100), connection timed out

192.168.*.* is a local address so one of two things has happened here:

  • You have incorrect proxy settings for Apt. If you are behind a proxy, add-apt-repository needs proxy settings too.
  • Your DNS is resolving in.archive.ubuntu.com (and other domains) to 192.168.5.100. This seems much less likely, but you can test with ping in.archive.ubuntu.com and check the IP is correct (not this local IP). This isn't impossible. A bad public wifi access point might redirect traffic around like this to force you into a portal.

The solution is essentially "fix your networking" but that should put you on the right path.

3
  • am not able to ping in.archive.ubuntu.com.
    – Anjana
    Jul 7, 2015 at 11:33
  • What IP does it resolve as though?
    – Oli
    Jul 7, 2015 at 11:34
  • it resolves to 91.189.92.201
    – Anjana
    Jul 7, 2015 at 11:35
1

Taken from your updated question:

Err http://in.archive.ubuntu.com/ubuntu/ trusty-updates/main openjdk-7-jdk amd64 7u79-2.5.5-0ubuntu0.14.04.2
  Could not connect to 192.168.5.100:80 (192.168.5.100), connection timed out

You have a serious problem with your network.

Some possibilities:

  • a misconfigured router/DNS server
  • a restricting proxy
  • a restricting firewall
  • you are part of an intranet with restricted internet access

The current version for OpenJDK is 1.7.0_79 in the officially Ubuntu repositories.

Therefore:

sudo apt-get update
sudo apt-get dist-upgrade

The error message

gpg: keyserver receive failed: keyserver error

is a temporary problem. Try ist again later.

3
  • it doesnt change anything. after i gave sudo apt-get update sudo apt-get dist-upgrade , and checked the version, its stil the same.
    – Anjana
    Jul 7, 2015 at 10:06
  • @Ridhima Try sudo apt-get install openjdk-7-jdk to explicitly ask the system to update this specific package.
    – Byte Commander
    Jul 7, 2015 at 10:25
  • @ByteCommander : i have edited the question and given there what I got when I gave this cmd. The version stil didnt change.
    – Anjana
    Jul 7, 2015 at 10:35
0

I followed this link How can I install Sun/Oracle's proprietary Java JDK 6/7/8 or JRE? . I manually did it and the version got changed to jdk1.7.0_80. Thanks for your time @A.B , @Oli and @Byte Commander.

Not the answer you're looking for? Browse other questions tagged .