Java Environment Setup - Mac

Complete Step By Step Java for Testers Setup and installation of required tools
6 minutes
Share the link to this page
Copied
  Completed
You need to have access to the item to view this lesson.
One-time Fee
$99.99
List Price:  $139.99
You save:  $40
€94.09
List Price:  €131.73
You save:  €37.64
£80.33
List Price:  £112.47
You save:  £32.13
CA$137.95
List Price:  CA$193.14
You save:  CA$55.18
A$155.90
List Price:  A$218.27
You save:  A$62.36
S$136.45
List Price:  S$191.03
You save:  S$54.58
HK$783.08
List Price:  HK$1,096.34
You save:  HK$313.26
CHF 91.31
List Price:  CHF 127.84
You save:  CHF 36.52
NOK kr1,099.13
List Price:  NOK kr1,538.83
You save:  NOK kr439.69
DKK kr702.04
List Price:  DKK kr982.89
You save:  DKK kr280.84
NZ$169.94
List Price:  NZ$237.92
You save:  NZ$67.98
د.إ367.20
List Price:  د.إ514.10
You save:  د.إ146.89
৳10,968.60
List Price:  ৳15,356.49
You save:  ৳4,387.88
₹8,361.11
List Price:  ₹11,705.89
You save:  ₹3,344.78
RM479.15
List Price:  RM670.83
You save:  RM191.68
₦120,104.65
List Price:  ₦168,151.32
You save:  ₦48,046.66
₨27,798.84
List Price:  ₨38,919.49
You save:  ₨11,120.65
฿3,667.03
List Price:  ฿5,133.99
You save:  ฿1,466.96
₺3,248.77
List Price:  ₺4,548.41
You save:  ₺1,299.64
B$518.45
List Price:  B$725.86
You save:  B$207.40
R1,905.92
List Price:  R2,668.37
You save:  R762.44
Лв184.07
List Price:  Лв257.70
You save:  Лв73.63
₩139,257.60
List Price:  ₩194,966.22
You save:  ₩55,708.61
₪377.23
List Price:  ₪528.13
You save:  ₪150.90
₱5,695.28
List Price:  ₱7,973.62
You save:  ₱2,278.34
¥15,458.12
List Price:  ¥21,641.98
You save:  ¥6,183.86
MX$1,680.99
List Price:  MX$2,353.45
You save:  MX$672.46
QR365.97
List Price:  QR512.38
You save:  QR146.40
P1,384.25
List Price:  P1,938
You save:  P553.75
KSh13,148.68
List Price:  KSh18,408.68
You save:  KSh5,260
E£4,851.82
List Price:  E£6,792.74
You save:  E£1,940.92
ብር5,709.83
List Price:  ብር7,993.99
You save:  ብር2,284.16
Kz83,396.59
List Price:  Kz116,758.56
You save:  Kz33,361.97
CLP$97,269.27
List Price:  CLP$136,180.87
You save:  CLP$38,911.60
CN¥723.78
List Price:  CN¥1,013.33
You save:  CN¥289.54
RD$5,930.22
List Price:  RD$8,302.55
You save:  RD$2,372.32
DA13,484.73
List Price:  DA18,879.17
You save:  DA5,394.43
FJ$227.82
List Price:  FJ$318.96
You save:  FJ$91.14
Q778.21
List Price:  Q1,089.53
You save:  Q311.31
GY$20,908.09
List Price:  GY$29,272.17
You save:  GY$8,364.07
ISK kr14,179.58
List Price:  ISK kr19,851.98
You save:  ISK kr5,672.40
DH1,015.88
List Price:  DH1,422.27
You save:  DH406.39
L1,779.82
List Price:  L2,491.82
You save:  L712
ден5,791.90
List Price:  ден8,108.89
You save:  ден2,316.99
MOP$805.91
List Price:  MOP$1,128.31
You save:  MOP$322.39
N$1,902.84
List Price:  N$2,664.06
You save:  N$761.21
C$3,694.12
List Price:  C$5,171.92
You save:  C$1,477.79
रु13,341.25
List Price:  रु18,678.28
You save:  रु5,337.03
S/371.93
List Price:  S/520.72
You save:  S/148.78
K379.86
List Price:  K531.82
You save:  K151.96
SAR375.07
List Price:  SAR525.11
You save:  SAR150.04
ZK2,516.51
List Price:  ZK3,523.21
You save:  ZK1,006.70
L468.24
List Price:  L655.55
You save:  L187.31
Kč2,375.47
List Price:  Kč3,325.75
You save:  Kč950.28
Ft37,163.97
List Price:  Ft52,031.05
You save:  Ft14,867.07
SEK kr1,095.61
List Price:  SEK kr1,533.90
You save:  SEK kr438.29
ARS$86,820.40
List Price:  ARS$121,552.04
You save:  ARS$34,731.63
Bs693.54
List Price:  Bs970.99
You save:  Bs277.44
COP$387,000.37
List Price:  COP$541,816
You save:  COP$154,815.63
₡50,265.75
List Price:  ₡70,374.06
You save:  ₡20,108.31
L2,477.69
List Price:  L3,468.86
You save:  L991.17
₲740,341.68
List Price:  ₲1,036,507.98
You save:  ₲296,166.29
$U3,889.78
List Price:  $U5,445.86
You save:  $U1,556.07
zł407.99
List Price:  zł571.20
You save:  zł163.21
Already have an account? Log In

Transcript

Hello all welcome back to the next one. In this one, how do we set up Java environment variable on a Mac system. And in the next one we will see about the Windows system. So if you have a Mac and you're trying to set up the Java home, let's continue. The first thing you want to do here is you want to open a terminal. What you do here is you press Command spacebar to spring sub, the spotlight search and you type terminal and this will bring up your terminal.

So in the last one we installed Java, right, but that does not mean that it has set up the Java environment variables for us. So that is something that we need to check. What we can do here is we can do echo dollar, Java underscore home and hit enter. So right now we see that there is this blank empty line right, which means the Java home is not set up and that's what we are trying to set we want to set the Java home properly What we can do here is we can open our bash profile on the Mac. So I'm gonna use nano, or if you want to use Wi Fi, you can use any command Basically, these are commands to open any file on a terminal. If you are not aware of multiple editors like this nano or VI, just follow what I'm doing.

So nano, the sign slash dot, bash, and profile. So this is the file you wanna open. And please, carefully notice these things. This is the sign just above the tab key. And then this is a slash, then a dot and bash underscore profile. After nano, you need a space, so please make sure you type perfectly if you're just new.

Otherwise, if you already are aware of these things, just go ahead and you hit enter and you'll see some thing like that. So basically what we want to do here is we want to set the Java home. So I already have the command up there, I just want to uncomment it, I just already typed it because I wanted to save some time typing stuff. So what you want us type here, this export space, and then capital, Java underscore capital home, please make sure that you type everything correctly. And then equal sign and then dollar and then you start the parenthesis. This is the usually number nine and number zero key for starting and ending the parenthesis you press Shift and start that after that, slash, user lib exec slash Java underscore home.

This is small, and then in the parenthesis so that's all you want to do here. I have some other settings for Python and audits. So don't worry about them. Once you type this, all you want to do here is either you can add it to your path also. So there is a path variable in bash profile, either you can just add this dollar Java home, but I think and then slash bin, it will be actually good, but I don't think it's necessary but we can just give it a try. So but I would say why not just do that because it's always good to have these things in the path.

So just uncomment this also. So what you can do here is you can do export space path path is capital equals dollar, Java home. So now what we are doing is we are referring this variable that we defined here using the dollar sign, and dollar Java home slash bin. So wherever the Java home is, slash bin, colon, and any other path you have, so I had this auto share ban, but you know what, I'm just gonna, I'm just gonna delete it so you guys don't get confused. So then again, dollar Java home slash bin, colon, dollar path. So it again refers the path.

So basically it adds dollar Java home slash bin to the existing path and it assigns it back to the path and then export the path. So basically, you can just simply do something like this. And don't worry about the science. These are done by my other program, which uses Python, so don't worry about it. So but you can do something like this. And I'm going to hit Ctrl O, it tells me right name, sorry, filename to write.

And I don't need to change the file name. And I'm going to hit enter. So it has written it says, wrote nine lines, and then I hit Ctrl x, so it's gonna kinda exit. Now what I can do here is I can do source and then just copy the same name and then hit enter. Now let's again try the same command equal dollar dollars our home and we might get it working. Yes, it is definitely working.

So now what it does is it shows my real Java home path. And please do not compare this path with the path that you might have on your computer it definitely can differ, yes, it can be different than what you are seeing on screen. So please do not worry about it. All you need to take care is just follow the procedure type this eco dollar Java home and you should see some path that should be because it will be different for your system. And the next thing if that also doesn't set up properly. The next thing that you want to do here is you want to type Java dash version.

And if this thing returns the correct Java version that you installed, then you're all set and good to go. You don't need to worry about anything. So if I type this thing It says Java version one dot A dot zero underscore six, zero. So this is the version that I actually installed. And I know that so basically I'm all good and said, this is also this also becomes optional, but it's always good to have Java home setup, I will all be suggested. And please try Java space dash version.

And if you see that you have a correct version, then you are already set and good to go. So that's about it. For Windows, please see the next lecture. And thanks for attending this one. Thanks a lot.

Sign Up

Share

Share with friends, get 20% off
Invite your friends to LearnDesk learning marketplace. For each purchase they make, you get 20% off (upto $10) on your next purchase.