Error: JAVA_HOME is set to an invalid directory: /usr/lib/jvm/java-8-oracle/jre/bin/java when i run gradle command in terminal Show
On a 64bit openSuse 64 42.1 box; readlink -f $(which java)provided; /usr/lib64/jvm/java-1.8.0-openjdk-1.8.0/jre/bin/javaBut; export JAVA_HOME=/usr/lib64/jvm/jre-1.8.0-openjdkin terminal run sudo nano /etc/environment and add the line JAVA_HOME="/usr/lib/jvm/java-12-oracle" Then open terminal and run export JAVA_HOME="/usr/lib/jvm/java-12-oracle" You need to login first then you can post Your Answer Log in Sign up 728x90 왠지 모르게 어느날부터 자바 셋팅이 꼬였는데 일단 gradle도 안되는 상황 ㅠㅠ 개발 환경mac -> vscode -> ssh -> remote linux server 맥에서 vscode로 리눅스 서버 접속 (remote extension 사용) 우선 jdk는 서버에 설치가 잘 되어 있는 상황이었다. (javac --version) 하니까 잘나옴 1. $ which java /usr/bin/java 2. $ readlink -f /usr/bin/java /usr/lib/jvm/java-11-openjdk-amd64/bin/java 여기서 뒤에 bin/java는 뺴야함 3. sudo vi /etc/bash.bashrc export JAVA_HOME="/usr/lib/jvm/java-11-openjdk-amd64/" 4. source /etc/bash.bashrc 5. reload 이랬더니 다니 gradle 이 되긴 한다.. 728x90
'기술 > Linux' 카테고리의 다른 글
BookmarksBookmarksPosting PermissionsHow do I fix Java Home is set to an invalid directory?To Solve ERROR: JAVA_HOME is set to an invalid directory Error Error Is saying that There is just no need to add bin into PATH variable. You need to set the JAVA_HOME like this. JAVA_HOME=”C:\Program Files\Java\jdk1. 8.0_131″ Just set JAVA_HOME like this and your error will be solved.
How do you fix please set the JAVA_HOME variable in your environment to match the location of your Java installation?To set JAVA_HOME, do the following: Right click My Computer and select Properties. On the Advanced tab, select Environment Variables, and then edit JAVA_HOME to point to where the JDK software is located, for example, C:\Program Files\Java\jdk1.
Why JAVA_HOME is not working?Verify JAVA_HOME
Enter the command echo %JAVA_HOME% . This should output the path to your Java installation folder. If it doesn't, your JAVA_HOME variable was not set correctly. Please make sure you're using the correct Java installation folder, or repeat the steps above.
What happens if JAVA_HOME is not set?If any program that requires a Java runtime fails to find the JAVA_HOME environment variable upon startup, or if the JAVA_HOME environment variable is misconfigured, it will result in some of the following error messages to be displayed: A Java installation exists but JAVA_HOME has been set incorrectly.
|