码迷,mamicode.com
首页 > 编程语言 > 详细

Centos6.7上yum安装jdk1.8的JAVA_HOME

时间:2016-05-23 22:53:23      阅读:843      评论:0      收藏:0      [点我收藏+]

标签:yum java_home

今天问题还挺多,在VMware上安装Btrace时遇到的,Btrace需要读服务器的JAVA_HOME,当时我配置的是JAVA_HOME=/usr(我以为java命令所在的目录就是JAVA_HOME,真是二的可以),怎么起不来,报错如下:

Caused by: java.lang.ClassNotFoundException:com.sun.source.util.TaskListener

询问了开发以后,开发告诉我这是jdk里面的类,应该是你的JAVA_HOME不对。Google了一下,确实是这个问题。

 

到服务器查了一下,如下

$ rpm -qa |grep jdk

java-1.8.0-openjdk-1.8.0.91-0.b14.el6_7.x86_64

java-1.8.0-openjdk-headless-1.8.0.91-0.b14.el6_7.x86_64

java-1.8.0-openjdk-devel-1.8.0.91-0.b14.el6_7.x86_64

 

$ rpm -qljava-1.8.0-openjdk-1.8.0.91-0.b14.el6_7.x86_64

/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.91-0.b14.el6_7.x86_64/jre/bin/policytool

/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.91-0.b14.el6_7.x86_64/jre/lib/amd64/libawt_xawt.so

/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.91-0.b14.el6_7.x86_64/jre/lib/amd64/libjawt.so

/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.91-0.b14.el6_7.x86_64/jre/lib/amd64/libjsoundalsa.so

/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.91-0.b14.el6_7.x86_64/jre/lib/amd64/libsplashscreen.so

/usr/share/applications/java-1.8.0-openjdk-1.8.0.91-0.b14.el6_7.x86_64-policytool.desktop

/usr/share/icons/hicolor/16x16/apps/java-1.8.0.png

/usr/share/icons/hicolor/24x24/apps/java-1.8.0.png

/usr/share/icons/hicolor/32x32/apps/java-1.8.0.png

/usr/share/icons/hicolor/48x48/apps/java-1.8.0.png

 

$ cd /usr/lib/jvm

$ ll

总用量 4

lrwxrwxrwx. 1 root root   26 5  17 16:59 java-> /etc/alternatives/java_sdk

lrwxrwxrwx. 1 root root   32 5  17 16:59java-1.8.0 -> /etc/alternatives/java_sdk_1.8.0

drwxr-xr-x. 7 root root 4096 5  1716:59 java-1.8.0-openjdk-1.8.0.91-0.b14.el6_7.x86_64

lrwxrwxrwx. 1 root root   46 5  17 16:59java-1.8.0-openjdk.x86_64 -> java-1.8.0-openjdk-1.8.0.91-0.b14.el6_7.x86_64

lrwxrwxrwx. 1 root root   34 5  17 16:59java-openjdk -> /etc/alternatives/java_sdk_openjdk

lrwxrwxrwx. 1 root root   21 5  17 16:54 jre ->/etc/alternatives/jre

lrwxrwxrwx. 1 root root   27 5  17 16:54jre-1.8.0 -> /etc/alternatives/jre_1.8.0

lrwxrwxrwx. 1 root root   50 5  17 16:54jre-1.8.0-openjdk-1.8.0.91-0.b14.el6_7.x86_64 ->java-1.8.0-openjdk-1.8.0.91-0.b14.el6_7.x86_64/jre

lrwxrwxrwx. 1 root root   50 5  17 16:54jre-1.8.0-openjdk.x86_64 ->java-1.8.0-openjdk-1.8.0.91-0.b14.el6_7.x86_64/jre

lrwxrwxrwx. 1 root root   29 5  17 16:54jre-openjdk -> /etc/alternatives/jre_openjdk

 

o(_)o ,找到了,JAVA_HOME/usr/lib/jvm/java


本文出自 “Hades博客” 博客,请务必保留此出处http://hades02.blog.51cto.com/9768670/1782261

Centos6.7上yum安装jdk1.8的JAVA_HOME

标签:yum java_home

原文地址:http://hades02.blog.51cto.com/9768670/1782261

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!