Oracle Linux Server release 6.3 下安装JDK
1、操作系统环境
Last login: Fri Feb 21 18:47:52 2014 from 192.168.56.1 [root@datacenter ~]# uname -a Linux datacenter.localdomain 2.6.39-200.24.1.el6uek.x86_64 #1 SMP Sat Jun 23 02:39:07 EDT 2012 x86_64 x86_64 x86_64 GNU/Linux [root@datacenter ~]# more /etc/issue Oracle Linux Server release 6.3 Kernel \r on an \m[root@datacenter ~]#
2、上传JDK安装包
[root@datacenter ~]# ll total 67296 -rw-------. 1 root root 1548 Feb 17 17:02 anaconda-ks.cfg drwxr-xr-x 2 root root 4096 Feb 21 18:37 bea -rw-r--r--. 1 root root 30877 Feb 17 17:02 install.log -rw-r--r--. 1 root root 9389 Feb 17 17:00 install.log.syslog -rw-r--r-- 1 root root 68852176 Feb 20 22:30 jdk-6u38-ea-bin-b04-linux-amd64-31_oct_2012-rpm.bin
3、创建JDK安装目录
[root@datacenter ~]# mkdir -p /opt/jdk [root@datacenter ~]# mv jdk-6u38-ea-bin-b04-linux-amd64-31_oct_2012-rpm.bin /opt/jdk/
4、移除以前的JDK
[root@datacenter ~]# rpm -qa | grep jdk java-1.6.0-openjdk-1.6.0.0-1.45.1.11.1.el6.x86_64 [root@datacenter ~]# yum remove java-1.6.0-openjdk-1.6.0.0-1.45.1.11.1.el6.x86_64 Loaded plugins: security Setting up Remove Process Resolving Dependencies --> Running transaction check ---> Package java-1.6.0-openjdk.x86_64 1:1.6.0.0-1.45.1.11.1.el6 will be erased --> Finished Dependency ResolutionDependencies Resolved==============================================================================================================================================Package Arch Version Repository Size ============================================================================================================================================== Removing:java-1.6.0-openjdk x86_64 1:1.6.0.0-1.45.1.11.1.el6 @anaconda-OracleLinuxServer-201206261930.x86_64/6.3 81 MTransaction Summary ============================================================================================================================================== Remove 1 Package(s)Installed size: 81 M Is this ok [y/N]: y Downloading Packages: Running rpm_check_debug Running Transaction Test Transaction Test Succeeded Running TransactionErasing : 1:java-1.6.0-openjdk-1.6.0.0-1.45.1.11.1.el6.x86_64 1/1 Verifying : 1:java-1.6.0-openjdk-1.6.0.0-1.45.1.11.1.el6.x86_64 1/1 Removed:java-1.6.0-openjdk.x86_64 1:1.6.0.0-1.45.1.11.1.el6 Complete!
5、安装JDK
[root@datacenter ~]# cd /opt/jdk/ [root@datacenter jdk]# ll total 67240 -rw-r--r-- 1 root root 68852176 Feb 20 22:30 jdk-6u38-ea-bin-b04-linux-amd64-31_oct_2012-rpm.bin [root@datacenter jdk]# chmod +x jdk-6u38-ea-bin-b04-linux-amd64-31_oct_2012-rpm.bin [root@datacenter jdk]# ll total 67240 -rwxr-xr-x 1 root root 68852176 Feb 20 22:30 jdk-6u38-ea-bin-b04-linux-amd64-31_oct_2012-rpm.bin [root@datacenter jdk]# ./jdk-6u38-ea-bin-b04-linux-amd64-31_oct_2012-rpm.bin Unpacking... Checksumming... Extracting... UnZipSFX 5.50 of 17 February 2002, by Info-ZIP (Zip-Bugs@lists.wku.edu).inflating: jdk-6u38-ea-linux-amd64.rpm inflating: sun-javadb-common-10.6.2-1.1.i386.rpm inflating: sun-javadb-core-10.6.2-1.1.i386.rpm inflating: sun-javadb-client-10.6.2-1.1.i386.rpm inflating: sun-javadb-demo-10.6.2-1.1.i386.rpm inflating: sun-javadb-docs-10.6.2-1.1.i386.rpm inflating: sun-javadb-javadoc-10.6.2-1.1.i386.rpm Preparing... ########################################### [100%]1:jdk ########################################### [100%] Unpacking JAR files...rt.jar...jsse.jar...charsets.jar...tools.jar...localedata.jar...plugin.jar...javaws.jar...deploy.jar... Installing JavaDB Preparing... ########################################### [100%]1:sun-javadb-common ########################################### [ 17%]2:sun-javadb-core ########################################### [ 33%]3:sun-javadb-client ########################################### [ 50%]4:sun-javadb-demo ########################################### [ 67%]5:sun-javadb-docs ########################################### [ 83%]6:sun-javadb-javadoc ########################################### [100%]Java(TM) SE Development Kit 6 successfully installed.Product Registration is FREE and includes many benefits: * Notification of new versions, patches, and updates * Special offers on Oracle products, services and training * Access to early releases and documentationProduct and system data will be collected. If your configuration supports a browser, the JDK Product Registration form will be presented. If you do not register, none of this information will be saved. You may also register your JDK later by opening the register.html file (located in the JDK installation directory) in a browser.For more information on what data Registration collects and how it is managed and used, see: http://java.sun.com/javase/registration/JDKRegistrationPrivacy.html Press Enter to continue.....Done.
6、配置/etc/profile环境变量,(新增加红色字体部分).
[root@datacenter jdk]# vi /etc/profile # /etc/profile# System wide environment and startup programs, for login setup # Functions and aliases go in /etc/bashrc# It's NOT a good idea to change this file unless you know what you # are doing. It's much better to create a custom.sh shell script in # /etc/profile.d/ to make custom changes to your environment, as this # will prevent the need for merging in future updates.pathmunge () {case ":${PATH}:" in*:"$1":*);;*)if [ "$2" = "after" ] ; thenPATH=$PATH:$1elsePATH=$1:$PATHfiesac }if [ -x /usr/bin/id ]; thenif [ -z "$EUID" ]; then# ksh workaroundEUID=`id -u`UID=`id -ru`fiUSER="`id -un`"LOGNAME=$USERMAIL="/var/spool/mail/$USER" fi# Path manipulation if [ "$EUID" = "0" ]; thenpathmunge /sbinpathmunge /usr/sbinpathmunge /usr/local/sbin elsepathmunge /usr/local/sbin afterpathmunge /usr/sbin afterpathmunge /sbin after fiHOSTNAME=`/bin/hostname 2>/dev/null` HISTSIZE=1000 if [ "$HISTCONTROL" = "ignorespace" ] ; thenexport HISTCONTROL=ignoreboth elseexport HISTCONTROL=ignoredups fiexport JAVA_HOME=/usr/java/jdk1.6.0_38/ export JAVA_BIN=/usr/java/jdk1.6.0_38/bin/ export PATH=$PATH:$JAVA_HOME/bin export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar export JAVA_HOME JAVA_BIN CLASSPATH export PATH USER LOGNAME MAIL HOSTNAME HISTSIZE HISTCONTROL# By default, we want umask to get set. This sets it for login shell # Current threshold for system reserved uid/gids is 200 # You could check uidgid reservation validity in "/etc/profile" 85L, 2013C written [root@datacenter jdk]# java -version java version "1.6.0_38-ea" Java(TM) SE Runtime Environment (build 1.6.0_38-ea-b04) Java HotSpot(TM) 64-Bit Server VM (build 20.13-b02, mixed mode)
7、验证JDK安装
[root@datacenter jdk]# 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" VMThe 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 | -jre-no-restrict-searchinclude/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-da[:<packagename>...|:<classname>]-disableassertions[:<packagename>...|:<classname>]disable assertions-esa | -enablesystemassertionsenable system assertions-dsa | -disablesystemassertionsdisable system assertions-agentlib:<libname>[=<options>]load native agent library <libname>, e.g. -agentlib:hprofsee 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
[root@datacenter jdk]# 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-d <directory> Specify where to place generated class files-s <directory> Specify where to place generated source 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-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
转载于:https://www.cnblogs.com/arcer/p/3560213.html
Oracle Linux Server release 6.3 下安装JDK相关推荐
- Red Hat Enterprise Linux Server release 7.1 (Maipo) 安装gcc 的几种方式
linux中没有默认安装的gcc,折腾了一番,终于搞好,记录备忘. [root@localhost local]# gcc bash: gcc: command not found... 查看系统版本 ...
- Red Hat Enterprise Linux Server release 6.3下ganglia监控系统的搭建
ganglia 是分布式的监控系统,有两个Daemon, 分别是:客户端Ganglia Monitoring Daemon (gmond)和服务端Ganglia Meta Daemon (gmetad ...
- Red Hat Enterprise Linux Server release 7.4 (Maipo) 安装mysql5.7.36
1. 版本 [root@localhost mysql]# cat /etc/redhat-release Red Hat Enterprise Linux Server release 7.4 (M ...
- ubuntu 64 12.04 oracle,ubuntu server 12.04 x86_64 下安装oracle xe 11 x86_64
1.下载oracle xe 我下载的是oracle-xe-11.2.0-1.0.x86_64.rpm.zip 2. 安装必要程序或文件 $sudo apt-get install unzip chkc ...
- redhat Enterprise Linux Server release 7.2(Maipo) 安装redis-stat
项目需要在rh7.2安装redis-stat,各种编译不过.通过一步步跟踪编译错误日志发现时缺少各种开发库. 需要安装的库列表如下: zlib-devel openssl-devel readline ...
- zzw原创_Red Hat Enterprise Linux Server release 6.5 安装mysql5.5.28版本
1.查看系统版本 [root@ip12189 ~]# more /etc/issue Red Hat Enterprise Linux Server release 6.5 (Santiago) K ...
- Red Hat Enterprise Linux Server release 7.0双系统安装
2019独角兽企业重金招聘Python工程师标准>>> Red Hat Enterprise Linux Server release 7.0双系统安装 1.RedHat 公司的企业 ...
- Linux下安装JDK笔记与Linux安装Tomcat笔记
项目需要,又要折腾Linux了,使用了VMware装一下linux,配置java运行环境,首先是配置JDK... OS:CentOS 64bit 一:到Oracle下载最新版的JDK http://w ...
- Linux下安装JDK,Tomcat,Mysql详细教程
1. 概述 今天教大家在linux下安装jdk,mysql以及tomcat.在javaweb开发中,最后完成的项目代码,一般都是布在linux服务器下的.因为linux服务器可以说是安全性稳定性都比w ...
最新文章
- R语言ggplot2可视化NHANES数据集年龄和身高的关系并按照性别因子分析男性和女性的差异
- linux定时器多次,Spring 定时器执行两次
- 如何应用Java的BigDecimal类
- OPM攻击事件后:我们从中学到了什么?
- SpringBoot_入门-课程简介
- 玩转算法之面试第十章-贪心算法
- mysql导入库排除某个表_mysql导入数据排除表-mysql导入数据排除某张表或多张表-吾爱编程网...
- UE4 打包C++项目到win32平台报错 could not find mspdbcore.dll
- 缓存架构不够好,系统容易瘫痪
- 绝杀《绝地求生》外挂!
- #和妹妹一起做毕业设计#从需求到软件发布的流程记录—— 需求、设计篇
- 【渝粤教育】电大中专工程图学基础_1作业 题库
- linux安装python3和pip3
- Python for Data Analysis | Names
- Photoshop照片一键转换手绘效果图动作
- TEWA-700G、TEWA-1000E/G等TEWA系列光猫获取超级密码
- MySQL数据库存储过程
- Mysterious Organization
- 2016年11月5日学习总结
- Cron表达式的语法及详细用法