Java教程

【allure】allure --version报错ERROR: JAVA_HOME is set to an invalid directory: /usr/local/opt/openjdk

本文主要是介绍【allure】allure --version报错ERROR: JAVA_HOME is set to an invalid directory: /usr/local/opt/openjdk,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!

1. 问题现象

appledeMacBook-Pro:~ apple$ allure -version

ERROR: JAVA_HOME is set to an invalid directory: /usr/local/opt/openjdk

Please set the JAVA_HOME variable in your environment to match the
location of your Java installation.

2. 处理方法

vim /usr/local/bin/allure

#!/bin/bash
JAVA_HOME="/Library/Java/JavaVirtualMachines/adoptopenjdk-8.jdk/Contents/Home" exec "/usr/local/Cellar/allure/2.13.9/libexec/bin/allure"  "$@"
JAVA_HOME换成自己系统安装的目录即可
这篇关于【allure】allure --version报错ERROR: JAVA_HOME is set to an invalid directory: /usr/local/opt/openjdk的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!