What does sudo ln -sfn do?

I installed JDK on my mac for Android studios (which I have done before) and I used Homebrew to install. At completion I got these suggestions? I would like to know if I want system Java wrappers to find JDK, Should I symlink it? and Why would I want it first in my path? Also I am using .zshrc as it is now default Catalina and wondering if I set $PATH variables the same way?

For the system Java wrappers to find this JDK, symlink it with sudo ln -sfn /usr/local/opt/openjdk/libexec/openjdk.jdk /Library/Java/JavaVirtualMachines/openjdk.jdk openjdk is keg-only, which means it was not symlinked into /usr/local, because it shadows the macOS `java` wrapper. If you need to have openjdk first in your PATH run: echo 'export PATH="/usr/local/opt/openjdk/bin:$PATH"' >> ~/.zshrc For compilers to find openjdk you may need to set: export CPPFLAGS="-I/usr/local/opt/openjdk/include" 

1 Answer

ln is the command creating the links between files, here is man page.

ln -sfn means force creating a new symlink.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like