Mac OS : How to configure JAVA Home ,Maven & Android Home
Recently I
have started using Mac OS and I had to
configure my Development environment for automation . To get started with the
basic needs i.e basic program to run , my system should have been configured
with JAVA_HOME , ANDROID_HOME and Maven(M2_HOME).
I learnt
the way how to configure all these settings, so I am sharing my knowledge in a
best possible way which can be understood easily. Also watch out my Youtube
Channel for videos related to this (link is given below)
Make sure
you have all these binaries installed or are downloaded and kept it in some
location.
Download
location :
JAVA can
be downloaded from (based on bitness of OS) : click
here to download
Android
SDK can be downloaded from(download Android studio, it will download the sdk) :
click here to
download
Let’s get
started with configuring these settings in OS path.
You can watch a Youtube video OR follow the step by step procedure below
Part 1
Part 2
Step 1 : Open Terminal on your Mac.
Step 2 : Type cd ~/
Step 3 : Check whether you have
.bash_profile present, type command
$ ls –al
Step 4 : If it is not present , let’s
create it using command
$ touch .bash_profile
(**
touch is a standard
Unix command-line interface program in its default usage, it is
equivalent of creating or opening a file and saving it without any change to
the file contents.)
Step 5 : Hit command ls –al again to
verify its presence
Step 6 : Now open .bash_profile file
which is just created. And to open you can use either of the commands.
$ open –e .bash_profile
( **
-e Opens with TextEdit.
-t Opens
with default text editor. )
OR
$ nano .bash_profile
(** GNU nano is
a popular command line text editor used on many operating
systems.)
Step 7 : How to configure JAVA_HOME
(You are required to give bin and
jre path . Make sure to replace wth your path)
export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_45.jdk/Contents/Home
export PATH=$PATH:$JAVA_HOME/bin
export PATH=$PATH:$JAVA_HOME/jre
Step 8 : How to configure ANDROID_HOME
(You are required to give
platform-tools ,build-tools and tools folder path. Make sure to replace wth your path)
export ANDROID_HOME=/Users/shakti/Library/Android/sdk
export PATH=$PATH:$ANDROID_HOME/platform-tools
export PATH=$PATH:$ANDROID_HOME/tools
export PATH=$PATH:$ANDROID_HOME/build-tools
Step 9 : How to configure MAVEN i.e M2_HOME
(You are required to give bin folder
path. Make sure to replace wth your path)
export
M2_HOME=/Users/shakti/allmywork/tools/maven-3.5.2
export PATH=$PATH:$M2_HOME/bin
Step 10 : Save and close the .bash_profile
Step 11 : To refresh the file or reload
the file, type below command
$
source .bash_profile
Step 12 : Check whether all of these JAVA
, MAVEN or ANDROID configured properly
or not by typing these multiple commands
-----------------------------------Java-------------------------------------------
$ echo $JAVA_HOME
$ javac
$ java --version
-----------------------------------Maven-------------------------------------------
$ echo
$M2_HOME
$ mvn
--version
$ mvn
-----------------------------------Android-------------------------------------------
$ echo
$ANDROID_HOME
$ adb
$ adb
devices
Hope this
helps you a bit in understanding how to configure these in path in Mac OS.
That’s it
!!
Apple knows MacBook and iMac webcams aren't made for taking photos worth sharing. Continuity Camera, Apple's solution to this issue, turns your iPhone into the camera your Mac doesn't have. thanks!
ReplyDelete================================
iot cloud services
Wow that was strange. I just wrote an really long comment but after I clicked submit my comment didn't show up. Grrrr... well I'm not writing all that over again. Anyhow, just wanted to say great blog! apple hilfe berlin
ReplyDelete