Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

centos 执行./as.sh报illegal ENV, please set $JAVA_HOME to JDK6+ #70

Closed
lxglove opened this issue Sep 19, 2018 · 3 comments
Closed

centos 执行./as.sh报illegal ENV, please set $JAVA_HOME to JDK6+ #70

lxglove opened this issue Sep 19, 2018 · 3 comments

Comments

@lxglove
Copy link

lxglove commented Sep 19, 2018

系统版本:
[jingle@JINGLE-PROD-JAVA01 ~]$ lsb_release -a
LSB Version: :core-4.1-amd64:core-4.1-noarch
Distributor ID: CentOS
Description: CentOS Linux release 7.3.1611 (Core)
Release: 7.3.1611
Codename: Core

执行java -version:
[jingle@JINGLE-PROD-JAVA01 ~]$ java -version
openjdk version "1.8.0_141"
OpenJDK Runtime Environment (build 1.8.0_141-b16)
OpenJDK 64-Bit Server VM (build 25.141-b16, mixed mode)

[jingle@JINGLE-PROD-JAVA01 ~]$ ./as.sh
Arthas script version: 3.0.4
illegal ENV, please set $JAVA_HOME to JDK6+

@lxglove lxglove closed this as completed Sep 19, 2018
@lxglove lxglove reopened this Sep 19, 2018
@lxglove
Copy link
Author

lxglove commented Sep 19, 2018

看有相似贴已解决,就关闭了,结果按照该贴子并没有解决我的问题

@hengyunabc
Copy link
Collaborator

需要设置 $JAVA_HOME的环境变量。检查是否已设置:

echo $JAVA_HOME

@lxglove
Copy link
Author

lxglove commented Sep 19, 2018

已解决,以下是步骤,前提示yum安装jdk1.8 注:$表示命令行
[root@localhost ~]# which java
/usr/bin/java
[root@localhost ~]# ls -lrt /usr/bin/java
lrwxrwxrwx 1 root root 22 9月 19 15:32 /usr/bin/java -> /etc/alternatives/java
[root@localhost ~]# ls -lrt /etc/alternatives/java
lrwxrwxrwx 1 root root 73 9月 19 15:32 /etc/alternatives/java -> /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.181-3.b13.el7_5.x86_64/jre/bin/java

[root@localhost ~]# vi /etc/profile
内容:
export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.181-3.b13.el7_5.x86_64
export JRE_HOME=${JAVA_HOME}/jre
export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib
export PATH=${JAVA_HOME}/bin:$PATH

保存退出执行 source /etc/profile(重要)
[root@localhost ~]# echo $JAVA_HOME
/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.181-3.b13.el7_5.x86_64

./as.sh ok了
谢谢!

@lxglove lxglove closed this as completed Sep 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants