zoukankan      html  css  js  c++  java
  • redhat配置java环境

    1.检查是否有旧版本的jdk

     java -version
    
    java version "1.4.2"
    
    gij (GNU libgcj) version 4.1.2 20080704 (Red Hat 4.1.2-48)
    
    Copyright (C) 2006 Free Software Foundation, Inc.
    
    This is free software; see the source for copying conditions.  There is NO
    
    warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    [root@localhost soft]# rpm -qa|grep gcj
    
    libgcj-4.1.2-48.el5
    
    java-1.4.2-gcj-compat-1.4.2.0-40jpp.115
    
    libgcj-4.1.2-48.el5

    2.卸载旧的jdk 

    [root@localhost soft]# rpm -e --nodeps java-1.4.2-gcj-compat-1.4.2.0-40jpp.115
    
    [root@localhost soft]# java -version
    
    -bash: /usr/bin/java: 没有那个文件或目录

     3.后安装新的jdk

    ./ jdk-1_5_0_15-linux-i586.bin
    
    mkdir /usr/java
    
    mv jdk1.5.0_15 /usr/java/
    
    ln -s /usr/java/jdk1.5.0_16/bin/java /usr/bin/java
    
    ln -s /usr/java/jdk1.5.0_16/bin/javac /usr/bin/javac
    
     

     4.编写环境变量:

     操作如下

    #vi /etc/profile 
    JAVA_HOME=/usr/java/jdk1.5.0_16 
    JRE_HOME=/usr/java/jdk1.5.0_16/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 

    5.使环境变量生效:

    #source /etc/profile

    版权声明:本文为博主原创文章,未经博主允许不得转载。

  • 相关阅读:
    sql语句游标的写法
    oracle的安装与plsql的环境配置
    oracle中创建表时添加注释
    jsp中Java代码中怎么获取jsp页面元素
    sql模糊查询
    jQuery循环给某个ID赋值
    Codeforces Round #671 (Div. 2)
    TYVJ1935 导弹防御塔
    Educational Codeforces Round 95 (Rated for Div. 2)
    Codeforces Round #670 (Div. 2)
  • 原文地址:https://www.cnblogs.com/weiguo21/p/4824019.html
Copyright © 2011-2022 走看看