Press Y to save the changes and press ENTER.Įxecute the below command: source ~/. The appropriate java version would be displayed in the terminal.Įxecute the below command to open the file: nano ~/.zshrcĪdd the below line to the file: export JAVA_HOME = $(/usr/libexec/java_home -v 1.6.0_65-b14–462 Step 3: Confirm if the java version has changedĮxecute the below command to check the java version: java -version Pick the required java version to be set and execute the below command with change to the java version as required.Įxport JAVA_HOME=”/usr/libexec/java_home -v 1.6.0_65-b14–462 Step 2: Assign the java home with the value. You would see something like below: 1.6.0_65-b14–462, x86_64: “Java SE 6” /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home Open up terminal and execute the below command. Step 1: View the available java version on the system. Pre-requisite: You must have java downloaded and installed on your system. The below is verified for macOS Big Sur, v11.6 To keep it short, following the below steps helps set the required java home path. Refer to your shell documentation if you have trouble doing this. It is a bit different to set up on a mac, than in windows. Environment variable PATH should be set to point to where the Java binaries have been installed. I hope this helps, but if it doesn't, please don't hesitate to share the error messages and step where it fails here.So recently, I changed my work machine to a mac. The "$" in front of the variable tells echo to look for a variable. You can verify if it was successfully created with echo $JAVA_HOME, echo being a command to display something. The "export" instruction creates an environment variable. This file will be automatically read and its instructions executed when you open your profile.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |