How to Install Java 17 | Set JAVA_HOME on Mac 2021 Edition

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hi everyone uh today we're gonna install java and we're gonna set up java home so that you can actually use java java download and uh am i recording okay i'm recording so uh from here you can go to so oracle site let's go to oracle site java downloads and then we have a download page and click on this mac os click on this apple logo and about this mac if you're using intel core then download x 64 compress the archive or dmg installer and if you recently bought a mac and if that has m1 chip then you have to download arm 64 download so uh i have i have intel chip so i'm going to download uh this one okay and then open up this is going to open up installer and double click and continue install and input your password install software and this is going to install java install succeeded and move to trash that's it and now what you have to do is set java home so that other applications that use java knows which java binary to run so the reason why uh java install doesn't take care of this is because theoretically you might be able to have multiple java versions and you want to be able to switch java versions switch between java versions depending on what you're making what your softwares require so first open up the terminal you can do command space and type terminal here if you have a new mac os apple recently changed their default terminal into z shell if you have older uh mac os you might be using bash shell depending on what you have uh how you how you set up java home might be different so you have to make sure which shell you're using and this is how you do it type echo and shell if you have this one slash bean slash z s h you then you're using z shell but instead if you have slash bin bash then you're using bash script okay so if you have bad shell don't worry i'm going to show you how to how to set up java home in bash shell as well so right now i'm going to show you how to do it in z shell after that i'm going to tell you how to do a bash okay so don't worry about it the next step is to type this we're going to type ls space hyphen al this is going to list out all the files and folders that you have on that specific directory so right now if you have z shell you might have a z s h e and v file if you don't have it uh you can do touch space tilde slash z shell in you can type you can type exactly okay if you created that z shell environment file what you're gonna do is to figure out where java binary jdk binary is located in order to find out i'm gonna type slash usr slash lib exec leave exact and java home so i installed jdk 17 so i have this thing printed out this is where uh jdk binary is located so what you're going to be doing what we're going to be doing is copy and paste this path where the java is jdk is located and then put it in the z shell environment file so let me make sure that java home is actually empty echo java this is how you print out environment variables okay so now it's empty so we're going to set that java home in z shell lymph so open open tilda slash z shell imp and then this file is empty right now what we're going to be doing is export make sure that export is actually all small case and um java java home and the copy and pasted value which is this long path this is where your java jdk binary is located save close what we're going to do is tell tell z shell that we actually um change something so apply the change into the current shell current shell so what we're going to be doing is uh source tilde slash z shell in and then now let's check if java home is java home is set echo java okay so right now java home is set up um so yeah this is it and now i'll show you how to do this same exact thing if you're using bash script a best shell i changed my shell to use bash instead of detail let's make sure if i'm using bash shell correctly so echo shell okay now i'm using bash binary so let's check if i have java home installed set so echo java home okay it's empty right if you're using bash script you need this file touch tilde slash profile okay let's make sure we have the program ls ao and okay we have this bash profile here and command k to clear out the clear amount of terminal and i'm going to open up that file and add java home open tilde period bash profile i have i have empty file here so i'm going to do export make sure e is lowercase keep changing you can actually use your favorite code code editor to write this export java home equals to this long path okay so actually if you install different versions of java you can actually change this version uh to i don't know 15 8 or something like that but we installed java jdk 17 so we're gonna have jdk 17 here and then save and then exit and then from our terminal i'm going to do source tilde slash bash profile this is going to uh tell shell to pick up uh updated bash profile and then uh use those environment variables and then after that let's check out let's see if java homie setup echo dollar sign java underscore home now jdk version the java home variable is set so you can actually use java other programs can use java correctly all right so this is the end of the video if i also have a video about how to switch uh java versions yeah check out the video if you're interested in if if you're interested in that in this channel we'll learn programming share career tips and learn how to be more productive uh so if you're interested in that please subscribe my channel uh click the like buttons for your youtube algorithm and see you guys next time bye make more money and be happy well it's just too much [Music] okay so in this channel we learn programming we learn programming share career tips uh so that we become more productive and possibly make more money why do you have to put that in there i don't know okay so yeah in this channel we we learn programming talk about career tips in tech and [Music] and product productivity tips [Music] oh in this channel we talk about [Music]
Info
Channel: Seho Lim
Views: 3,726
Rating: undefined out of 5
Keywords: java, install java jdk, java development kit, how to install java, install java on mac, install jdk on mac, zshell, bash, java_home, set java_home, export Java_home, download java, java download, java tutorial, java tutorial for beginners, learn java, Java17, Jdk17, Install jdk17, Install java17, Install java, Install jdk
Id: hRThN2gal6U
Channel Id: undefined
Length: 10min 14sec (614 seconds)
Published: Mon Oct 25 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.