Linux中查看jdk版本详解程序员

linux查看java jdk安装路径和设置环境变量                   

windows:
set java_home:查看JDK安装路径
java -version:查看JDK版本

linux:
whereis java
which java (java执行路径)
 
echo $JAVA_HOME

echo $PATH

二:下面是配置linux的环境变量:(记得source .bash_profile) . 修改/etc/profile文件 (全局所有用户)

vi 此文件/etc/profile 在profile文件末尾加入:

vi 此文件/etc/profile
在profile文件末尾加入:
export JAVA_HOME=/usr/share/jdk1.6.0_20
export PATH=$JAVA_HOME/bin:$PATH
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
.修改.bash_profile文件 (某个用户权限使用这些环境变量)
.bash_profile文件末尾加入:

export JAVA_HOME=/usr/share/jdk1.6.0_20
export PATH=$JAVA_HOME/bin:$PATH
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
.shell终端执行下列命令: (临时用)
export JAVA_HOME=/usr/share/jdk1.6.0_14
export PATH=$JAVA_HOME/bin:$PATH
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar

Linux中查看jdk版本详解程序员
 三. 卸载jdk ·找到jdk安装目录的_uninst子目录 ·在shell终端执行命令./uninstall.sh即可卸载jdk。

Linux 系统如何查看系统配置信息

一:查看cpu 
[[email protected] /]# more /proc/cpuinfo | grep "model name" 
model name       : Intel(R) Xeon(R) CPU            X3220 @ 2.40GHz 
model name       : Intel(R) Xeon(R) CPU            X3220 @ 2.40GHz 
model name       : Intel(R) Xeon(R) CPU            X3220 @ 2.40GHz 
model name       : Intel(R) Xeon(R) CPU            X3220 @ 2.40GHz 
[[email protected] /]# grep "model name" /proc/cpuinfo 
model name       : Intel(R) Xeon(R) CPU            X3220 @ 2.40GHz 
model name       : Intel(R) Xeon(R) CPU            X3220 @ 2.40GHz 
model name       : Intel(R) Xeon(R) CPU            X3220 @ 2.40GHz 
model name       : Intel(R) Xeon(R) CPU            X3220 @ 2.40GHz 
[[email protected] /]# grep "model name" /proc/cpuinfo | cut -f2 -d: 
Intel(R) Xeon(R) CPU            X3220 @ 2.40GHz 
Intel(R) Xeon(R) CPU            X3220 @ 2.40GHz 
Intel(R) Xeon(R) CPU            X3220 @ 2.40GHz 
Intel(R) Xeon(R) CPU            X3220 @ 2.40GHz 

二:查看内存 [[email protected] /]# grep MemTotal /proc/meminfo MemTotal: 614400 kB [[email protected] /]# free -g

[[email protected] /]# free -m total used free shared buffers cached Mem: 600 23 576 0 0 0 -/+ buffers/cache: 23 576 Swap: 0 0 0 [[email protected] /]# free -m |grep "Mem" | awk '{print $2}' 600[[email protected] /]#grep MemTotal /proc/meminfo | cut -f2 -d:
614400 kB
(k|K|m|M) 以k|kB|m|MB为单位显示,对应转换(1000|1024|1000000|1048576) 三:查看CPU位数(32 or 64) [[email protected] /]# getconf LONG_BIT 32
四:查看linux版本 [[email protected] /]# more /etc/redhat-release CentOS release 5 (Final) [[email protected] /]# more /etc/issue CentOS release 5 (Final) Kernel /r on an /m [[email protected] /]# more /proc/version Linux version 2.6.18-92.1.18.el5.028stab060.2PAE ([[email protected]][email protected][/email]) (gc c version 4.1.2 20071124 (Red Hat 4.1.2-42)) #1 SMP Tue Jan 13 12:31:30 MSK 2009 五:查看内核版本 [[email protected] /]# uname -r 2.6.18-92.1.18.el5.028stab060.2PAE [[email protected] /]# uname -a Linux srv.eddiechen.cn 2.6.18-92.1.18.el5.028stab060.2PAE #1 SMP Tue Jan 13 12:31:30 MSK 2009 i686 i686 i386 GNU/Linux 六:查看时区 [[email protected] /]# date -R Wed, 25 Feb 2009 02:20:50 +0000 [[email protected] /]# mv /etc/localtime /etc/localtime.save [[email protected] /]# cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime [[email protected] /]# date -R Wed, 25 Feb 2009 10:24:26 +0800 七:主机名 [[email protected] /]# hostname srv.eddiechen.cn 八:查看selinux情况 [[email protected] /]# sestatus SELinux status: disabled 九:网络 IP [[email protected] /]# ifconfig | grep 'inet addr:'| grep -v '127.0.0.1' | cut -d: -f2 | awk '{ print $1}' 207.154.202.216 网关 [[email protected] /]# cat /etc/sysconfig/network NETWORKING="yes" GATEWAY="192.0.2.1" HOSTNAME="srv.eddiechen.cn" dns [[email protected] /]# cat /etc/resolv.conf nameserver 208.74.168.131 nameserver 208.74.168.132 nameserver 4.2.2.1 十:已经安装的软件包 [[email protected] /]# rpm -qa | wc -l 197 [[email protected] /]# yum list installed | wc -l 198 十一:磁盘和分区 [[email protected] /]# df -h Filesystem Size Used Avail Use % Mounted on /dev/simfs 10G 353M 9.7G 4% / [[email protected] /]# du -sh 353M [[email protected] /]# du /etc -sh 4.6M /etc

原创文章,作者:ItWorker,如若转载,请注明出处:https://blog.ytso.com/1453.html

(0)
上一篇 2021年7月15日
下一篇 2021年7月15日

相关推荐

发表回复

登录后才能评论