CentOS-6.4-x86_64中安装jdk-8u20-linux-x64

软件版本:jdk-8u20-linux-x64.rpm

下载地址:

http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html

(1)、查找OpenJDK的包

[[email protected] ~]# rpm -qa | grep java
java-1.6.0-openjdk-1.6.0.0-1.50.1.11.5.el6_3.x86_64
tzdata-java-2012j-1.el6.noarch
java_cup-0.10k-5.el6.x86_64
java-1.7.0-openjdk-1.7.0.9-2.3.4.1.el6_3.x86_64
java-1.5.0-gcj-1.5.0.0-29.1.el6.x86_64
gcc-java-4.4.7-3.el6.x86_64

(2)、检查OpenJDK的版本

[[email protected] ~]# java -version
java version "1.7.0_09-icedtea"
OpenJDK Runtime Environment (rhel-2.3.4.1.el6_3-x86_64)
OpenJDK 64-Bit Server VM (build 23.2-b09, mixed mode)
[[email protected] ~]#

(3)、卸载OpenJDK

[[email protected] ~]# rpm -e --nodeps java-1.6.0-openjdk-1.6.0.0-1.50.1.11.5.el6_3.x86_64
[[email protected] ~]# rpm -e --nodeps tzdata-java-2012j-1.el6.noarch
[[email protected] ~]# rpm -e --nodeps java_cup-0.10k-5.el6.x86_64
[[email protected] ~]# rpm -e --nodeps java-1.7.0-openjdk-1.7.0.9-2.3.4.1.el6_3.x86_64
[[email protected] ~]# rpm -e --nodeps java-1.5.0-gcj-1.5.0.0-29.1.el6.x86_64
[[email protected] ~]# rpm -e --nodeps gcc-java-4.4.7-3.el6.x86_64

(4)、安装jdk-8u20-linux-x64.rpm

[[email protected] Downloads]# rpm -ivh jdk-8u20-linux-x64.rpm 
Preparing...                ########################################### [100%]
   1:jdk1.8.0_20            ########################################### [100%]
Unpacking JAR files...
        rt.jar...
        jsse.jar...
        charsets.jar...
        tools.jar...
        localedata.jar...
        jfxrt.jar...
[[email protected] Downloads]#

(5)、配置环境变量

[[email protected] jdk1.8.0_20]# cat << EOF >>/etc/profile
> JAVA_HOME=/usr/java/jdk1.8.0_20
> JRE_HOME=/usr/java/jdk1.8.0_20/jre
> PATH=$PATH:$JAVA_HOME/bin:$JRE_HOME/bin
> CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar:$JRE_HOME/lib
> export JAVA_HOME JRE_HOME PATH CLASSPATH
> EOF
[[email protected] jdk1.8.0_20]#

使环境变量立即生效:

[[email protected] jdk1.8.0_20]# source /etc/profile

(6)、测试安装是否成功

[[email protected] jdk1.8.0_20]# java
[[email protected] jdk1.8.0_20]# java -version
[[email protected] jdk1.8.0_20]# javac

详情如下:

[[email protected] jdk1.8.0_20]# java

Usage: java [-options] class [args...]

(to execute a class)

or  java [-options] -jar jarfile [args...]

(to execute a jar file)

where options include:

-d32          use a 32-bit data model if available

-d64          use a 64-bit data model if available

-server       to select the "server" VM

The default VM is server.

-cp <class search path of directories and zip/jar files>

-classpath <class search path of directories and zip/jar files>

A : separated list of directories, JAR archives,

and ZIP archives to search for class files.

-D<name>=<value>

set a system property

-verbose:[class|gc|jni]

enable verbose output

-version      print product version and exit

-version:<value>

require the specified version to run

-showversion  print product version and continue

-jre-restrict-search | -no-jre-restrict-search

include/exclude user private JREs in the version search

-? -help      print this help message

-X            print help on non-standard options

-ea[:<packagename>...|:<classname>]

-enableassertions[:<packagename>...|:<classname>]

enable assertions with specified granularity

-da[:<packagename>...|:<classname>]

-disableassertions[:<packagename>...|:<classname>]

disable assertions with specified granularity

-esa | -enablesystemassertions

enable system assertions

-dsa | -disablesystemassertions

disable system assertions

-agentlib:<libname>[=<options>]

load native agent library <libname>, e.g. -agentlib:hprof

see also, -agentlib:jdwp=help and -agentlib:hprof=help

-agentpath:<pathname>[=<options>]

load native agent library by full pathname

-javaagent:<jarpath>[=<options>]

load Java programming language agent, see java.lang.instrument

-splash:<imagepath>

show splash screen with specified image

See http://www.oracle.com/technetwork/java/javase/documentation/index.html for more details.

[[email protected] jdk1.8.0_20]# java -version

java version "1.8.0_20"

Java(TM) SE Runtime Environment (build 1.8.0_20-b26)

Java HotSpot(TM) 64-Bit Server VM (build 25.20-b23, mixed mode)

[[email protected] jdk1.8.0_20]# javac

Usage: javac <options> <source files>

where possible options include:

-g                         Generate all debugging info

-g:none                    Generate no debugging info

-g:{lines,vars,source}     Generate only some debugging info

-nowarn                    Generate no warnings

-verbose                   Output messages about what the compiler is doing

-deprecation               Output source locations where deprecated APIs are used

-classpath <path>          Specify where to find user class files and annotation processors

-cp <path>                 Specify where to find user class files and annotation processors

-sourcepath <path>         Specify where to find input source files

-bootclasspath <path>      Override location of bootstrap class files

-extdirs <dirs>            Override location of installed extensions

-endorseddirs <dirs>       Override location of endorsed standards path

-proc:{none,only}          Control whether annotation processing and/or compilation is done.

-processor <class1>[,<class2>,<class3>...] Names of the annotation processors to run; bypasses default discovery process

-processorpath <path>      Specify where to find annotation processors

-parameters                Generate metadata for reflection on method parameters

-d <directory>             Specify where to place generated class files

-s <directory>             Specify where to place generated source files

-h <directory>             Specify where to place generated native header files

-implicit:{none,class}     Specify whether or not to generate class files for implicitly referenced files

-encoding <encoding>       Specify character encoding used by source files

-source <release>          Provide source compatibility with specified release

-target <release>          Generate class files for specific VM version

-profile <profile>         Check that API used is available in the specified profile

-version                   Version information

-help                      Print a synopsis of standard options

-Akey[=value]              Options to pass to annotation processors

-X                         Print a synopsis of nonstandard options

-J<flag>                   Pass <flag> directly to the runtime system

-Werror                    Terminate compilation if warnings occur

@<filename>                Read options and filenames from file

时间: 2024-10-11 21:21:32

CentOS-6.4-x86_64中安装jdk-8u20-linux-x64的相关文章

解决CentOS虚拟机中安装jdk出现中文乱码问题

(1)我在给该虚拟机安装jdk是通过借助winscp工具来实现的,首先双击winscp.exe进入到winscp登录界面,在环境这一项里将文件名UTF-8编码设置为开启,如下图所示: (2)然后再点击会话这一选项,输入主机名,用户名和密码,点击保存后,进行登入,如下图所示: (3)接下来进入到CentOS虚拟机中,进入到/etc/sysconfig/i18n文件中,将里面的内容修改为:LANG="zh_CN.GB18030" LANGUAGE="zh_CN.GB18030:z

在linux中安装JDK,并设置环境变量:

在linux中安装JDK,并设置环境变量: apt-get install open jdk-7-jdk vim /etc/profile 设置环境变量: null

虚拟机上在Linux系统中安装JDK的方法

1.   mkdir /soft      (创建一个目录,用于存放安装软件 ) 2.     cd /soft      (切换到soft目录 ) 3. rz(从windows中选择安装包) 4.rmp  -ivh jdk-7u45-linux-x64.rpm   (安装JDK) 5.find / -name 'jdk' 6.vi /etc/profile  (编辑环境变量)  在profile的最后写下面的地址 export JAVA_HOME=/usr/java/jdk1.7.0_45ex

linux 中安装JDK

一般公司差不多所有的服务器都是搭建在Linux上面的,所以这就免不了,(要是使用Java语言)要在Linux上面布一套JDK也就是Java虚拟机环境. 下面,我具体说一下安装过程,以及可能出现的问题. 首先你要把Linux拷贝到你的Linux系统文件夹中. 2:如果你的JDK是压缩文件,你就要在Linux下执行命令 ./JDK (记住一定要到当前路径下)这样就进行解压缩了.如果在Linux中不让你进行解压缩,你就执行命令 chmod u+x  JDK(给它赋予权限) 3:配置环境变量:执行命令

在CentOS 6.5 中安装JDK 1.7 + Eclipse

一.安装JDK 1.7 1. 卸载OpenJDK rpm -qa | grep java rpm -e --nodeps java-1.6.0-openjdk-1.6.0.0-1.50.1.11.5.el6_3.x86_64 rpm -e --nodeps java-1.7.0-openjdk-1.7.0.9-2.3.4.1.el6_3.x86_64 rpm -e --nodeps tzdata-java-2012j-1.el6.noarch 2. 下载:①从我的网盘下载 jdk-7u60-li

centos中安装jdk的操作

安装jdk的操作 环境:centos6.8 检查centos6.8自带的jdk #查询版本 [[email protected] package]$ java -version java version "1.7.0_99" OpenJDK Runtime Environment (rhel-2.6.5.1.el6-x86_64 u99-b00) OpenJDK 64-Bit Server VM (build 24.95-b01, mixed mode) #查询文件全名 [[email

在CentOS7.4中安装jdk的几种方法及配置环境变量

一.下载jdk jdk下载地址:http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html 下载jdk-8u152-linux-x64.rpm 或 jdk-8u152-linux-x64.tar.gz(根据自己的系统位数选择对应的包) 如图: 二.安装jdk 1.因为我安装的CentOS7.4系统自带jdk1.8,所以为了演示如何安装jdk,我需要先卸载系统自带的jdk 查看当前系统jdk

CentOS下用yum命令安装jdk

一.使用yum命令安装1.查看是否已安装JDK,卸载[plain] view plain copy[[email protected] ~]# yum list installed |grep java  [plain] view plain copyjava-1.8.0-openjdk.x86_64             1:1.8.0.121-0.b13.el7_3          @updates   java-1.8.0-openjdk-headless.x86_64    1:1.

在Linux虚拟机中安装JDK和MySQL

注意:本文中的Linux环境是安装在VMware虚拟机中,系统用的CentOS6.5,本文中的安装步骤只适用于CentOS7.0以下的版本. 下面,进入正文. 一.安装JDK 在安装jdk前,需要先查看系统中是否已经安装jdk. 可以看到,系统已经安装了jdk1.6和jdk1.7,所以在安装前需要先卸载之前已经安装好的jdk. 将已经安装好的jdk都卸载后,上传要安装的jdk的安装包 上传方式: 使用第三方上传插件 使用rz命令上传文件 开始安装: 有的系统可能需要依赖: 1 yum insta

CentOS 6.3(x86_64)下安装Oracle 10g R2

目 录 一.硬件要求二.软件三.系统安装注意四.安装Oracle前的系统准备工作五.安装Oracle,并进行相关设置六.升级Oracle到patchset 10.2.0.4七.使用rlwrap调用sqlplus中历史命令 一.硬件要求 1.内存 & swap Minimum: 1 GB of RAMRecommended: 2 GB of RAM or more 检查内存情况 # grep MemTotal /proc/meminfo # grep SwapTotal /proc/meminfo