close

[Solved] Wrong JAVA_HOME after upgrade to macOS Big Sur v11.0.1

Hello Guys, How are you all? Hope You all Are Fine. Today I am facing the following error Wrong JAVA_HOME after upgrade to macOS Big Sur v11.0.1 in Java. So Here I am Explain to you all the possible solutions here.

Without wasting your time, Let’s start This Article to Solve This Error.

How Wrong JAVA_HOME after upgrade to macOS Big Sur v11.0.1 Error Occurs?

Today I am facing the following error Wrong JAVA_HOME after upgrade to macOS Big Sur v11.0.1 in Java.

How To Solve tWrong JAVA_HOME after upgrade to macOS Big Sur v11.0.1 Error ?

  1. How To Solve tWrong JAVA_HOME after upgrade to macOS Big Sur v11.0.1 Error ?

    To Solve tWrong JAVA_HOME after upgrade to macOS Big Sur v11.0.1 Error As I tryed. I just delete the /Library/Internet Plug-Ins/JavaAppletPlugin.plugin and relogin. Then everything works fine.

  2. Wrong JAVA_HOME after upgrade to macOS Big Sur v11.0.1

    To Solve tWrong JAVA_HOME after upgrade to macOS Big Sur v11.0.1 Error As I tryed. I just delete the /Library/Internet Plug-Ins/JavaAppletPlugin.plugin and relogin. Then everything works fine.

Solution 1

Seems in macOS Big Sur v11.0.1 the behavior of the /usr/libexec/java_home -v ... command has changed: it is sensitive to the previously set value of JAVA_HOME environment variable.

Exact behavior is not clear, I couldn’t find any documentation on this, but in my experiments it reported the version already set in JAVA_HOME, regardless of the -v switch:

% JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home /usr/libexec/java_home -v 1.8.0_162
/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home

Additionally, I noticed that it reports nothing, if JAVA_HOME is set, but doesn’t point to a valid java home (also for -V):

% JAVA_HOME=dummy /usr/libexec/java_home -v 1.7.0_45
% JAVA_HOME=dummy /usr/libexec/java_home -V
%

Solution is to ensure JAVA_HOME is not set before executing /usr/libexec/java_home:

% unset JAVA_HOME ; /usr/libexec/java_home -v 1.8.0_162
/Library/Java/JavaVirtualMachines/jdk1.8.0_162.jdk/Contents/Home

Solution 2

As I tryed. I just delete the /Library/Internet Plug-Ins/JavaAppletPlugin.plugin and relogin. Then everything works fine.

Summery

It’s all About this issue. Hope all solution helped you a lot. Comment below Your thoughts and your queries. Also, Comment below which solution worked for you? Thank You.

Also, Read