转: CentOS安装jdk8
from: http://tecadmin.net/install-java-8-on-centos-rhel-and-fedora/
After a long wait, finally Java SE Development Kit 8 is available to download. JDK 8 has been released on Mar,18 2014 for general availability with the many featured enhancements. You can find all the enhancements in JDK 8 here.
This article will help you to Install JAVA 8 (JDK 8u66) or update on your system. Read instruction carefully for downloading java from Linux command line. To Install Java 8 in Ubuntu and LinuxMint read This Article.
Downloading Latest Java Archive
Download latest Java SE Development Kit 8 release from its official download page or use following commands to download from shell.
For 64Bit
# cd /opt/
# wget --no-cookies --no-check-certificate --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie" "http://download.oracle.com/otn-pub/java/jdk/8u111-b14/jdk-8u111-linux-x64.tar.gz" # tar xzf jdk-8u111-linux-x64.tar.gz
For 32Bit
# cd /opt/
# wget --no-cookies --no-check-certificate --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie" "http://download.oracle.com/otn-pub/java/jdk/8u111-b14/jdk-8u111-linux-i586.tar.gz" # tar xzf jdk-8u111-linux-i586.tar.gz
Note: If Above wget command does not work for you watch this example video to download java source archive using terminal.
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_111/
# alternatives --install /usr/bin/java java /opt/jdk1.8.0_111/bin/java 2
# alternatives --config java There are 3 programs which provide 'java'. Selection Command
-----------------------------------------------
* 1 /opt/jdk1.7.0_71/bin/java
+ 2 /opt/jdk1.8.0_45/bin/java
3 /opt/jdk1.8.0_91/bin/java
4 /opt/jdk1.8.0_111/bin/java Enter to keep the current selection[+], or type selection number: 4
At this point JAVA 8 has been successfully installed on your system. We also recommend to setup javac and jar commands path using alternatives
# alternatives --install /usr/bin/jar jar /opt/jdk1.8.0_111/bin/jar 2
# alternatives --install /usr/bin/javac javac /opt/jdk1.8.0_111/bin/javac 2
# alternatives --set jar /opt/jdk1.8.0_111/bin/jar
# alternatives --set javac /opt/jdk1.8.0_111/bin/javac
Check Installed Java Version
Check the installed Java version on your system using following command.
root@tecadmin ~# java -version java version "1.8.0_111"
Java(TM) SE Runtime Environment (build 1.8.0_111-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.111-b14, mixed mode)
Configuring Environment Variables
Most of Java based application’s uses environment variables to work. Set the Java environment variables using following commands
- Setup JAVA_HOME Variable
# export JAVA_HOME=/opt/jdk1.8.0_111
- Setup JRE_HOME Variable
# export JRE_HOME=/opt/jdk1.8.0_111/jre
- Setup PATH Variable
# export PATH=$PATH:/opt/jdk1.8.0_111/bin:/opt/jdk1.8.0_111/jre/bin
Also put all above environment variables in /etc/environment file for auto loading on system boot.
转: CentOS安装jdk8的更多相关文章
- Centos安装jdk8
1.下载jdk1.8的tar cd /usr/local/src #切换到该目录下 wget url #下载jdk8的tar包 2.下载完成后解压tar包 tar -zxvf jdk-8u152-li ...
- 腾讯云Centos安装jdk8
1.下载jdk1.8的tar cd /usr/local/src #切换到该目录下 wget url #下载jdk8的tar包 2.下载完成后解压tar包 tar -zxvf jdk-8u152-li ...
- centos 安装 jdk8和comcat8
1.去官网下载Linux版本的jdk8 2.进入ags,把tar.gz的压缩包拷贝到用户下指定目录java,然后解压 mkdir /home/ags/java tar -zxv -f jdk-8u11 ...
- CentOS安装gitlab,gerrit,jenkins并配置ci流程
CentOS安装gitlab,gerrit,jenkins并配置ci流程 By Wenbin juandx@163.com 2016/4/9 这是我参考了网上很多的文档,配置了这三个软件在一个机器上, ...
- 【推荐】CentOS安装Subversion-1.8.11+HTTP协议支持配置
注:以下所有操作均在CentOS 6.5 x86_64位系统下完成. 我们需要搭建一个自己的SVN服务器. 此外,搭建好的SVN服务器除了需要支持svn协议外,最好还需要支持HTTP协议和HTTPS协 ...
- 【推荐】CentOS安装PHP-5.6.4+扩展安装+安全配置+性能配置
注:以下所有操作均在CentOS 6.5 x86_64位系统下完成. #准备工作# 前段时间PHP官方发布了一个重要的安全升级公告,修复了两个unserialize函数的严重漏洞,目前受影响的版本有: ...
- CentOS安装Apache-2.4.10+安全配置
注:以下所有操作均在CentOS 6.5 x86_64位系统下完成. #准备工作# 在安装Nginx之前,请确保已经使用yum安装了各基础组件,并且配置了www用户和用户组,具体见<CentOS ...
- CentOS安装Nginx-1.6.2+安全配置
注:以下所有操作均在CentOS 6.5 x86_64位系统下完成. #准备工作# 在安装Nginx之前,请确保已经使用yum安装了pcre等基础组件,具体见<CentOS安装LNMP环境的基础 ...
- CentOS安装MySQL-5.6.10+安全配置
注:以下所有操作均在CentOS 6.5 x86_64位系统下完成. #准备工作# 在安装MySQL之前,请确保已经使用yum安装了各类基础组件,具体见<CentOS安装LNMP环境的基础组件& ...
随机推荐
- October 17th 2016 Week 43rd Monday
You only live once, but if you do it right, once is enough. 人生只有一次,但如果活对了,一次也就够了. Whether you do it ...
- ASP.NET知识总结(3.HTTP协议详解)
引言 HTTP是一个属于应用层的面向对象的协议,由于其简捷.快速的方式,适用于分布式超媒体信息系统.它于1990年提出,经过几年的使用与发展,得到不断地完善和扩展.目前在WWW中使用的是HTTP/1. ...
- nginx 反向代理 配置 https 实现http https同时存在
server { listen ssl; #监听443端口 server_name www.app01.com; ssl on; #启用ssl加密 ssl_certificate /etc/cert/ ...
- Java正则表达式实现字符串的动态多替换
需求场景: 今天在处理SQL语句的时候,由于数据库中存的格式是VARCHAR2型的,这就需要对SQL语句中WHERE条件后边的带数字的字符串加上单引号,对于字符串的处理,首先想到的就是正则表达式,对正 ...
- MVC Controller Dependency Injection for Beginners【翻译】
在codeproject看到一篇文章,群里的一个朋友要帮忙我翻译一下顺便贴出来,这篇文章适合新手,也算是对MEF的一个简单用法的介绍. Introduction In a simple stateme ...
- DEV express 对Gridview某行的元素赋值
1:获取选中的行某列的值 string colValue= this.gridView1.GetRowCellValue(this.gridView1.FocusedRowHandle, this.g ...
- Html中鼠标悬停显示二级菜单的两种方法
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title> ...
- 《DSP using MATLAB》示例Example5.8
代码: n = [0:1:99]; x = cos(0.48*pi*n) + cos(0.52*pi*n); n1 = [0:1:9]; y1 = x(1:1:10); % N = 10 figure ...
- 浏览器控制台console
console对象 console对象代表浏览器的JavaScript控制台.虽然它还不是标准,但是各大浏览器都原生支持,已经成为事实上的标准. console对象主要有两个作用: 显示网页代码运行时 ...
- 2016 ccpc 网络选拔赛 F. Robots
Robots Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Subm ...