{"id":461,"date":"2014-01-22T09:25:50","date_gmt":"2014-01-22T09:25:50","guid":{"rendered":"http:\/\/hosting-marketers.com\/news\/?p=461"},"modified":"2014-01-22T09:33:33","modified_gmt":"2014-01-22T09:33:33","slug":"installing-java-7-on-centos-6-openjdk","status":"publish","type":"post","link":"https:\/\/hosting-marketers.com\/news\/2014\/01\/22\/installing-java-7-on-centos-6-openjdk\/","title":{"rendered":"Installing java 7 on centos 6 (OpenJDK)"},"content":{"rendered":"<p>We use to run java OpenJDK 6 on our servers, but the new version OpenJDK 7 is more secure and some of our customers have start requesting, so here are the instructions for installing and setting the correct variables.<\/p>\n<p>For the previous post on installing OpenJDK 6 please see <a title=\"red5 installation\" href=\"http:\/\/hosting-marketers.com\/news\/2010\/01\/17\/how-to-install-red5-version-0-8-and-0-9-on-centos-5-4\/\" target=\"_blank\">red5 installation<\/a>.<\/p>\n<p>Please note that it is possible to have on the same server both version OpenJDK 6 and OpenJDK 7.<\/p>\n<p>First command, let us install OpenJDK:<\/p>\n<p># <code>yum install java-1.7.0-openjdk-devel<\/code><\/p>\n<p>Linux Centos servers include a utility called <code>alternatives<\/code>, which lets you change the default version for applications which allow multiple versions to be installed. OpenJDK is one such application.<\/p>\n<ul>\n<li>\n<div>The <code>alternatives<\/code> command is not installed by default, but may already be installed on your system. If not, install the <code>alternatives<\/code> package by running the following command:<\/div>\n<pre># yum install alternatives<\/pre>\n<\/li>\n<li>\n<div>Issue the following command:<\/div>\n<pre># \/usr\/sbin\/alternatives --config java<\/pre>\n<\/li>\n<\/ul>\n<p>the output could be something like:<\/p>\n<pre><strong># alternatives --config java\r\n<\/strong>\r\nThere are 2 programs which provide 'java'.\r\n\r\n  Selection    Command\r\n-----------------------------------------------\r\n1\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 \/usr\/lib\/jvm\/jre-1.6.0-openjdk\/bin\/java\r\n2\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 \/usr\/lib\/jvm\/jre-1.7.0-openjdk\/bin\/java\r\n\r\nEnter to keep the current selection[+], or type selection number: 2<\/pre>\n<p>if you type 2 the you selecting the OpenJDK 7.<\/p>\n<p>and you can confirm by entering the command:<\/p>\n<p># java -version<\/p>\n<p>the output should be something like:<\/p>\n<p>[root@live ~]# java -version<br \/>\njava version &#8220;1.7.0_51&#8221;<br \/>\nOpenJDK Runtime Environment (rhel-2.4.4.1.el6_5-i386 u51-b02)<br \/>\nOpenJDK Client VM (build 24.45-b08, mixed mode, sharing)<\/p>\n<p>Setup Environment Variables<\/p>\n<p>Most of java based application\u00e2\u20ac\u2122s uses environment variables to work. Use following commands to setup it.<br \/>\n# export JAVA_HOME=\/usr\/lib\/jvm\/jre-1.7.0-openjdk\/bin\/java<\/p>\n<p># export CLASSPATH=.:$JAVA_HOME\/lib\/classes.zip<\/p>\n<p>Also export these variables in \/etc\/bashrc to become available for every user login or for any terminal opens.<br \/>\n# echo export JAVA_HOME=\/usr\/lib\/jvm\/jre-1.7.0-openjdk\/bin\/java &gt;&gt; \/etc\/bashrc<\/p>\n<p># echo export CLASSPATH=.:$JAVA_HOME\/lib\/classes.zip &gt;&gt; \/etc\/bashrc<\/p>\n<p>Check if the variables are correct:<\/p>\n<p># <code>echo $JAVA_HOME<\/code><\/p>\n<p>output should be:<\/p>\n<p>[root@live ~]# echo $JAVA_HOME<br \/>\n\/usr\/lib\/jvm\/jre-1.7.0-openjdk\/bin\/java<br \/>\n[root@live ~]#<\/p>\n<p>&nbsp;<\/p>\n<p>That&#8217;s it.<\/p>\n<!-- AddThis Advanced Settings generic via filter on the_content --><!-- AddThis Share Buttons generic via filter on the_content -->","protected":false},"excerpt":{"rendered":"<p>We use to run java OpenJDK 6 on our servers, but the new version OpenJDK 7 is more secure and some of our customers have start requesting, so here are the instructions for installing and setting the correct variables. For the previous post on installing OpenJDK 6 please see red5 installation. Please note that it [&hellip;]<!-- AddThis Advanced Settings generic via filter on get_the_excerpt --><!-- AddThis Share Buttons generic via filter on get_the_excerpt --><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_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":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[2],"tags":[103],"class_list":["post-461","post","type-post","status-publish","format-standard","hentry","category-hosting-marketers-news","tag-java7-installation"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p9Yxzd-7r","jetpack-related-posts":[{"id":150,"url":"https:\/\/hosting-marketers.com\/news\/2010\/01\/17\/how-to-install-red5-version-0-8-and-0-9-on-centos-5-4\/","url_meta":{"origin":461,"position":0},"title":"How To Install RED5 version 0.8 or 0.9 on CENTOS","author":"Admin","date":"January 17, 2010","format":false,"excerpt":"RED5 is open source flash server written in java supports streaming audio\/video, recording client streams, shared objects, live stream publishing etc. In this short steps you can install red5 server on your virtual server or dedicated. This is post is being modified on 27th August 2013, the installation is for\u2026","rel":"","context":"In &quot;rtmp hosting&quot;","block_context":{"text":"rtmp hosting","link":"https:\/\/hosting-marketers.com\/news\/category\/rtmp-hosting\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":529,"url":"https:\/\/hosting-marketers.com\/news\/2015\/05\/17\/how-to-install-java-8-jdk-8u45-on-centos-6-64-bit\/","url_meta":{"origin":461,"position":1},"title":"How to install Java 8 (JDK 8u45) on Centos 6- 64 bit","author":"Admin","date":"May 17, 2015","format":false,"excerpt":"# cd \/opt\/ # wget http:\/\/hosting-marketers.com\/downloads\/jdk-8u45-linux-x64.tar.gz # tar xzf jdk-8u45-linux-x64.tar.gz Install Java with Alternatives After extracting archive file use alternatives command to install it. alternatives command is available in chkconfig package. # cd \/opt\/jdk1.8.0_45\/ # alternatives --install \/usr\/bin\/java java \/opt\/jdk1.8.0_45\/bin\/java 2 # alternatives --config java There are 3 programs which\u2026","rel":"","context":"In &quot;Hosting Marketers News&quot;","block_context":{"text":"Hosting Marketers News","link":"https:\/\/hosting-marketers.com\/news\/category\/hosting-marketers-news\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":533,"url":"https:\/\/hosting-marketers.com\/news\/2015\/07\/04\/download-red5-0-8-final-1-0-2-1-0-5\/","url_meta":{"origin":461,"position":2},"title":"Download Red5 | 0.8 final | 1.0.2 | 1.0.5","author":"Admin","date":"July 4, 2015","format":false,"excerpt":"Sometimes you cannot find the red5 version you need, specially the 0.8 and the 1.0.2, for this reason we decided to upload to our servers these versions. Download red5 0.8 final Download red5 1.0.2 version Just in case the 1.0.5 version you can also download it here. For the installation\u2026","rel":"","context":"In &quot;Hosting Marketers News&quot;","block_context":{"text":"Hosting Marketers News","link":"https:\/\/hosting-marketers.com\/news\/category\/hosting-marketers-news\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":822,"url":"https:\/\/hosting-marketers.com\/news\/2019\/07\/16\/installing-ffmpeg-and-ffprobe-on-centos-with-the-latest-ffmpeg-version\/","url_meta":{"origin":461,"position":3},"title":"Installing FFMPEG and FFprobe on Centos with the latest FFMPEG version","author":"Admin","date":"July 16, 2019","format":false,"excerpt":"how to install ffmpeg and ffprobe on centos 7 with the latest ffmpeg version","rel":"","context":"In &quot;Hosting Marketers News&quot;","block_context":{"text":"Hosting Marketers News","link":"https:\/\/hosting-marketers.com\/news\/category\/hosting-marketers-news\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":162,"url":"https:\/\/hosting-marketers.com\/news\/2010\/02\/13\/how-to-install-the-latest-ffmpeg-mplayer-mencoder-ffmpeg-php-on-centos-server\/","url_meta":{"origin":461,"position":4},"title":"How To Install FFmpeg, Mplayer, Mencoder, FFmpeg-PHP on a CentOS server","author":"Admin","date":"February 13, 2010","format":false,"excerpt":"I tried first to use the installer of ScriptMantra but for some reason there were errors sometimes the Liba52, sometimes the Mplayer were not installed, so I just gave up and used the autoinstaller just to remove all traces of ffmpeg on the server, then I used the yum to\u2026","rel":"","context":"In &quot;Hosting Marketers News&quot;","block_context":{"text":"Hosting Marketers News","link":"https:\/\/hosting-marketers.com\/news\/category\/hosting-marketers-news\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":127,"url":"https:\/\/hosting-marketers.com\/news\/2009\/10\/21\/installing-red5-the-simple-way\/","url_meta":{"origin":461,"position":5},"title":"Installing red5, the simple way!","author":"Admin","date":"October 21, 2009","format":false,"excerpt":"It is not working any more, some files have been changed and our installer is now outdated, soon we will fix the issue. January 2010. The following steps are intended to automate the installation of Red 5 versions 0.5 , 0.6.3 and 0.7.0 . I know there is now 0.8\u2026","rel":"","context":"In &quot;Hosting Marketers News&quot;","block_context":{"text":"Hosting Marketers News","link":"https:\/\/hosting-marketers.com\/news\/category\/hosting-marketers-news\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/hosting-marketers.com\/news\/wp-json\/wp\/v2\/posts\/461","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/hosting-marketers.com\/news\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/hosting-marketers.com\/news\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/hosting-marketers.com\/news\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/hosting-marketers.com\/news\/wp-json\/wp\/v2\/comments?post=461"}],"version-history":[{"count":4,"href":"https:\/\/hosting-marketers.com\/news\/wp-json\/wp\/v2\/posts\/461\/revisions"}],"predecessor-version":[{"id":465,"href":"https:\/\/hosting-marketers.com\/news\/wp-json\/wp\/v2\/posts\/461\/revisions\/465"}],"wp:attachment":[{"href":"https:\/\/hosting-marketers.com\/news\/wp-json\/wp\/v2\/media?parent=461"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hosting-marketers.com\/news\/wp-json\/wp\/v2\/categories?post=461"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hosting-marketers.com\/news\/wp-json\/wp\/v2\/tags?post=461"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}