{"id":490,"date":"2013-07-16T12:41:48","date_gmt":"2013-07-16T11:41:48","guid":{"rendered":"http:\/\/tech.moosaico.com\/blog\/?p=490"},"modified":"2013-10-18T11:57:16","modified_gmt":"2013-10-18T10:57:16","slug":"update-java-in-linux-ubuntu","status":"publish","type":"post","link":"https:\/\/thejoyofstick.com\/blog\/2013\/07\/16\/update-java-in-linux-ubuntu\/","title":{"rendered":"Update Java in Linux Ubuntu"},"content":{"rendered":"<p>Tired of the browser pop-up window asking you to update Java ?<\/p>\n<p>Yes, and we should do it specially because of the usual security concerns.<br \/>\nI&#8217;ve done this with Ubuntu 13.04 and 12.04 LTS.<\/p>\n<p>Go to the <a href=\"http:\/\/java.com\/en\/download\/manual.jsp\" title=\"Java Download page\" target=\"_blank\">Java download page<\/a> and get your &#8220;Linux&#8221; or &#8220;Linux x64&#8221; version.<\/p>\n<p>I got the x64 one.<\/p>\n<p>Let&#8217;s unpack it. I already have <code>\/opt\/java\/64<\/code>. You may have a different place.<\/p>\n<pre lang=\"linux\">\r\n$ cd \/opt\/java\/64\/\r\n\r\n$ sudo tar zxvf ~biafra\/Downloads\/jre-7u25-linux-x64.tar.gz\r\n<\/pre>\n<p>Now update Ubuntu configuration with the new Java options<\/p>\n<pre lang=\"linux\">\r\n$ sudo update-alternatives --install \"\/usr\/bin\/java\" \"java\" \"\/opt\/java\/64\/jre1.7.0_25\/bin\/java\" 1\r\n$ sudo update-alternatives --install \"\/usr\/bin\/javaws\" \"javaws\" \"\/opt\/java\/64\/jre1.7.0_25\/bin\/javaws\" 1\r\n\r\n$ sudo update-alternatives --install \"\/usr\/lib\/mozilla\/plugins\/libjavaplugin.so\" \"mozilla-javaplugin.so\" \"\/opt\/java\/64\/jre1.7.0_25\/lib\/amd64\/libnpjp2.so\" 1\r\n<\/pre>\n<p>Let&#8217;s force Ubuntu to use the new update<\/p>\n<pre lang=\"linux\">\r\n$ sudo update-alternatives --config java\r\nThere are 2 choices for the alternative java (providing \/usr\/bin\/java).\r\n\r\n  Selection    Path                               Priority   Status\r\n------------------------------------------------------------\r\n* 0            \/opt\/java\/64\/jre1.7.0_21\/bin\/java   2000      auto mode\r\n  1            \/opt\/java\/64\/jre1.7.0_21\/bin\/java   2000      manual mode\r\n  2            \/opt\/java\/64\/jre1.7.0_25\/bin\/java   1         manual mode\r\n\r\nPress enter to keep the current choice[*], or type selection number: 2\r\nupdate-alternatives: using \/opt\/java\/64\/jre1.7.0_25\/bin\/java to provide \/usr\/bin\/java (java) in manual mode\r\n<\/pre>\n<p>Done!<\/p>\n<p><strong>Warning!<\/strong> You may think that everything is fine now but there&#8217;s a bug in the new update. If you try to open a page with a Java application you may be redirected to java.com!<\/p>\n<p>I used this workaround:<\/p>\n<pre lang=\"linux\">\r\n$ rm ~\/.java\/deployment\/config.cache\r\n<\/pre>\n<p>Go to the page which need Java and it will work again as expected.<\/p>\n<p><strong>Update 2013.10.18:<\/strong> Depending on your browser you may have to update your default java plugin with<\/p>\n<pre lang=\"linux\">\r\n$ sudo update-alternatives --config mozilla-javaplugin.so\r\n<\/pre>\n<p>or<\/p>\n<pre lang=\"linux\">\r\n$ sudo update-alternatives --config firefox-javaplugin.so\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Tired of the browser pop-up window asking you to update Java ? Yes, and we should do it specially because of the usual security concerns. I&#8217;ve done this with Ubuntu 13.04 and 12.04 LTS. Go to the Java download page&hellip; <a href=\"https:\/\/thejoyofstick.com\/blog\/2013\/07\/16\/update-java-in-linux-ubuntu\/\" class=\"more-link\">Continue Reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[7,34,4],"tags":[70,69,20],"class_list":["post-490","post","type-post","status-publish","format-standard","hentry","category-apps","category-desktop","category-ubuntu","tag-brower","tag-java","tag-ubuntu-2"],"jetpack_shortlink":"https:\/\/wp.me\/pcmwlL-7U","jetpack_sharing_enabled":true,"jetpack_likes_enabled":false,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/thejoyofstick.com\/blog\/wp-json\/wp\/v2\/posts\/490","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/thejoyofstick.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/thejoyofstick.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/thejoyofstick.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/thejoyofstick.com\/blog\/wp-json\/wp\/v2\/comments?post=490"}],"version-history":[{"count":22,"href":"https:\/\/thejoyofstick.com\/blog\/wp-json\/wp\/v2\/posts\/490\/revisions"}],"predecessor-version":[{"id":570,"href":"https:\/\/thejoyofstick.com\/blog\/wp-json\/wp\/v2\/posts\/490\/revisions\/570"}],"wp:attachment":[{"href":"https:\/\/thejoyofstick.com\/blog\/wp-json\/wp\/v2\/media?parent=490"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/thejoyofstick.com\/blog\/wp-json\/wp\/v2\/categories?post=490"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/thejoyofstick.com\/blog\/wp-json\/wp\/v2\/tags?post=490"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}