一、下载jdk

参考:http://www.codingyun.com/article/40.html

可以先下载到本地,然后ftp到服务器

也可以直接在服务器下载(windows版本的区分32位与64位,ubuntu(linux)版本的不区分)

http://download.oracle.com/otn-pub/java/jdk/8u65-b17/jdk-8u65-linux-x64.tar.gz?AuthParam=1447866593_14c651521d060c106fe19b59b69722e4

 
   

有问题(wget 得到的只是网页 5037什么的),可以参考:http://www.cnblogs.com/1995hxt/p/4976436.html,后边的AuthParam自己F12获取

   

二、解压安装

先解压

 
1
tar zxvf jdk-8u65-linux-x64.tar.gz -C /usr/java/

然后改名为java7

 
1
cd /usr/java/
 
1
mv jdk1.8.0_xx java8

三、配置环境变量

 
1
vi ~/.bashrc

在最后面加上如下四句

 
1
2
3
4
export JAVA_HOME=/usr/java/java8
export JRE_HOME=${JAVA_HOME}/jre
export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib
export PATH=${JAVA_HOME}/bin:$PATH

保存后退出vi 刷新变量使配置立即生效

 
1
source ~/.bashrc

进入tomcat的bin目录

 
1
cd $CATALINA_HOME/bin

四、测试

snowdream@snowdream:~$ java -version

aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAiQAAABuCAIAAACYzZ8EAAAUnUlEQVR4nO2dzbmsuA5FiYdUGHUYBMKgwyCBTqCCe28A2JIsyTbYFMXZ67uDeyiw5V9hA9rDv//9M9zDOK+fdR6HYRim5bNM7MdpOX6jpxPor+EXdgm7gCU/kguulGBa1OQVthxzZymXqOUtsKsqq1q09Md57ZvpF/I123ec12Ua57V3gR9Gvl9NS2VXNTgxXsDv0cPZqKNynNfYK6cl20Pp+bTXE7c0LbSDGpPBtEQfw2yoZVpCOqlrVO2vdTZqeasu7EHv9B+SL/Visv6n5fP3nE1h/bdqpb9WvX+R4Gy2G+t1Ho9b7Nj05J6b9QfluLg//1AnsXXK/fYx9NBwhdVnnXtZ1kELemsYP/ROajNoOy6KHmxNkp8WskgKZV6m/VZvP38mv5DCLou3RNLKuxmiFo9NjFa5h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94qL4IfUWbb2oxPQlD0GZZluPtgHgi0cNwdDLcB/KKs1Gdt60Xcka349j5hLMBAFzmzo86K1WpfpG8LG6zjPpreYQdxfypcDYAAB+Eq2lFXDv8wfgIcDYAAB84G9AAOBsAgA+cDWgAnA0AwAfOBgAAQHf+/e8f/MM//MM//MO/rv/+D6b31RjcefixAAAAAElFTkSuQmCC" alt="" />

												

Linux 安装配置JDK的更多相关文章

  1. linux经常使用(一)linux 安装配置 jdk之 找不到安装文件文件夹及source /etc/profile 报unexpected end of file 错误 解决

    linux 安装配置 jdk 应该算是一个非常主要的东西.可是我到如今才自己第一次 正式安装.果然出现了问题.. 问题就是 安装之后 找不到 安装路径 ,进而没法配置环境变量. 现象例如以下: 提示 ...

  2. Linux安装配置JDK

    如果想看Windows下的安装,请访问此链接: http://www.cnblogs.com/yoyotl/p/5101321.html 1. 去官网下载Linux版本的jdk安装包,(我下载的是ta ...

  3. Linux 安装配置JDK 、 MySQL 、nginx

    今天我来讲一下在Linux下各环境的搭建,主要就讲一下jdk.MySQL.和一个代理服务器nginx 1. jdk的安装配置 1)卸载自带openjdk 当我们拿到一个全新的ECS的时候上面有的会自带 ...

  4. Linux安装配置JDK与卸载

    最近在Linux系统部署门户,安装Oracle,导入dmp,JDK等等,遇到一大堆问题,解决后特有一番小小成就感,哇哈哈!在这里记录一下遇到问题: 官网下载JDK压缩包( .tar.gz ):http ...

  5. Linux 安装配置 JDK 8

    所需软件包, 可以到Oracle官网去下载,  放到/usr/local/src文件夹下: jdk-8u45-linux-x64.tar.gz 安装: cd /usr/local/srctar -zx ...

  6. linux安装配置JDK脚本

    #!/bin/bash # install jdk and configuring environment variables function installjdk(){ tar -zxf jdk- ...

  7. Linux下配置JDK

    下面以CentOS为例,详细说一下Linux下配置JDK的过程 首先按照约定俗成的习惯,将jdk放在/usr/local/java下,首先进入/usr/local然后新建一个目录java 然后我们需要 ...

  8. 安装配置JDK+Eclipse+Maven、Eclipse里新建Maven Project以及HDFS命令和Java API-课堂内容

    步骤:1.安装JDK→2.安装Eclipse→3.安装Maven→4. Eclipse里配置Maven (下载Windows版本,在Windows里安装使用.) 1.安装配置JDK ①官网下载Java ...

  9. Linux安装配置php环境的方法

    本文实例讲述了Linux安装配置php环境的方法.分享给大家供大家参考,具体如下: 1.获取安装文件: http://www.php.net/downloads.php php-5.3.8.tar.g ...

随机推荐

  1. asp.net高并发网站解决方案【未完成版本】

    场景:假设现在是一个电商网站,今天要举办活动,有10个商品低价销售,但是会来抢购的人会特别多,最后只有十个人可以成功的买到商品   明确2个问题 1.访问量:抢票时间断用户访问量 2.并发:1秒内请求 ...

  2. 从0开始学习 Git

    1. 什么是Git? Git 是 Linux 发明者 Linus 开发的一款新时代的版本控制系统,那什么是版本控制系统呢?怎么理解?网上一大堆详细的介绍,但是大多枯燥乏味,对于新手也很难理解,这里我只 ...

  3. 图解HTTP总结(3)——HTTP报文内的HTTP信息

    HTTP通信过程包括从客户端发往服务端的请求及从服务器端返回客户端的响应. 用于HTTP协议交互的信息被称为HTTP报文.客户端的HTTP报文叫做请求报文,服务器端的叫做响应报文.HTTP报文本身是多 ...

  4. 10.2 ajax

    Ajax Ajax简介 AJAX(Asynchronous Javascript And XML)翻译成中文就是“异步Javascript和XML”.即使用Javascript语言与服务器进行异步交互 ...

  5. 11 Django组件-分页器

    Django的分页器(paginator) view from django.shortcuts import render,HttpResponse # Create your views here ...

  6. com.squareup.okhttp.Interceptor

    retrift 集成了okhttp,所以,我们以后就不用再单独的引用http的jar 了. 但是,今天遇到一个问题,就是okhttp是这样设置一些intercept的: private static ...

  7. sprintf()函数使用异常

    调试STM32F103,比如如下代码:使用springf函数,这个函数是把最后两个参数先格式化成字符串 ,输出到ERROR_STRING,如果他们合并的长度大于30会出现深情况? ] sprintf( ...

  8. PowerShell技巧:使用XPath语法查询XML文件

    [TechTarget中国原创] XML是存储结构化数据的一个很好的途径,但是想要让数据在其中发挥作用又会有些困难.每一种语言都有其特定方式来查询XML文件中的命名空间.元素及属性.PowerShel ...

  9. 云计算之路-阿里云上:SLB引起的https访问速度慢问题

    自从我们在阿里云SLB上部署了https之后(详见在SLB上部署https遇到的问题及解决方法),陆续有园友向我们反馈登录时速度很慢(登录时是通过https访问),有些园友甚至无法访问登录页面. 而我 ...

  10. Windows下安装jenkins,关闭jenkins,修改jenkins端口号

    1.Jenkins安装部署 在官网下载Jenkins: https://jenkins.io/download/thank-you-downloading-windows-installer-stab ...