Tuesday, 29 July 2014

How to generate keygen on mac

How to generate keygen on mac 
Here you can see all the details to setup git on your mac laptop
http://guides.beanstalkapp.com/version-control/git-on-mac.html

how to mention chrome driver path on mac for selenium bdd cucumber java

For Mac chrome driver resides in this path. Here in mac chrome path extentions is .app 

//Applications//Google Chrome.app//Contents//MacOS//Google Chrome

If your chrome driver is not working properly then 
Open this path on your browser so that automatically downloads chrome browser in required path.

Monday, 28 July 2014

vi or vim editor commands help

vi or vim editor commands help

http://www.cyberciti.biz/faq/save-file-in-vi-vim-linux-apple-macos-unix-bsd/

how to setup maven on Mac

Maven setup on Mac laptop

1) Being as a first point you have to download maven
Download from this link
http://maven.apache.org/download.cgi

2) Create folders on your mac
Click Go->Go to folder /usr/local
right click create new folder “apache-maven”
open this folder and again create sub folder
folder name “apache-maven-3.2.2” Hint- based up on your maven version you can put folder name

3)Then open Terminal command prompt .
localhost:~ userid$ cd /usr/local
localhost:local userid$ ls
apache-maven git libexec
localhost:local userid$ cd apache-maven
localhost:apache-maven userid$ ls
apache-maven-3.2.2
localhost:apache-maven userid$ cd apache-maven-3.2.2
localhost:apache-maven-3.2.2 userid$ export M2_HOME=/usr/local/apache-maven/apache-maven-3.2.2
localhost:apache-maven-3.2.2 userid$ M2=$M2_HOME/bin
localhost:apache-maven-3.2.2 userid$ export PATH=$M2:$PATH
localhost:apache-maven-3.2.2 userid$ echo $JAVA_HOME
/Library/Java/Home
localhost:apache-maven-3.2.2 userid$ mvn --version
Apache Maven 3.2.2 (45f7c06d68e745d05611f7fd14efb6594181933e; 2014-06-17T14:51:42+01:00)
Maven home: /usr/local/apache-maven/apache-maven-3.2.2
Java version: 1.6.0_65, vendor: Apple Inc.
Java home: /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home
Default locale: en_US, platform encoding: MacRoman
OS name: "mac os x", version: "10.9.2", arch: "x86_64", family: "mac"

localhost:apache-maven-3.2.2 userid$ whereis mvn

To find path where is maven use this command
localhost:apache-maven-3.2.2 userid$mvn -version

Now your maven setup done.






More detailed Help details :

http://maven.apache.org/download.cgi
As per above link you can get details as below.

details available on bottom of the page. 
Extract the distribution archive, i.e. apache-maven-3.2.2-bin.tar.gz to the directory you wish to install Maven 3.2.2.
 These instructions assume you chose /usr/local/apache-maven. The subdirectory apache-maven-3.2.2 will
 be created from the archive.

In a command terminal, add the M2_HOME environment variable, e.g. export M2_HOME=/usr/local/apache-maven/apache-maven-3.2.2.

Add the M2 environment variable, e.g. export M2=$M2_HOME/bin.

Optional: Add the MAVEN_OPTS environment variable to specify JVM properties, e.g. export MAVEN_OPTS="-Xms256m -Xmx512m".
 This environment variable can be used to supply extra options to Maven.

Add M2 environment variable to your path, e.g. export PATH=$M2:$PATH.

Make sure that JAVA_HOME is set to the location of your JDK, e.g.
 export JAVA_HOME=/usr/java/jdk1.7.0_51 and that $JAVA_HOME/bin is in your PATH environment variable.

Run mvn --version to verify that it is correctly installed.

how to setup up JAVA_HOME environment variable on mac

How to setup up JAVA_HOME environment variable on mac laptop

Being as a first point
Open Terminal from your mac this is command prompt on mac laptop.
Now type echo $JAVA_HOME it should return java details if it is already installed.
So that you will come to know. whether it is existed or not.

In Mac laptop all environment variables will setup in bash_profile

So if you are first time setting up in the scene it might not exist. So to let you know whether it is existed or not Type below command  on Terminal command prompt.

ls -1 ~/.bash_profile

If it is not existed then it will say “No such file or directory”

Now type this command
touch ~/.bash_profile

Now open file in vim editor this is editor in unix.
vim ~/.bash_profile
it will open some text editor.
If you try to type any thing on this.. it wont allow.. if you want to insert any thing please press
esc + i   it allow to enter data into vim editor

Now enter these lines on that editor

export JAVA_HOME=/Library/Java/Home
export JRE_HOME=/Library/Java/Home

Now you have to save and exit from the editor to do that please press escape : colon then wq
6. esc + :wq
To execute that file please enter this command.
7. source ~/.bash_profile
To check java details please enter this command
8. echo $JAVA_HOME
9.echo $JRE_HOME

Any how please have some help on this video
JAVA_HOME environment setup help video on mac



To make sure those environment variables work in all sessions.
We have to do as below.

type env | grep M2_HOME on the terminal that is working. This should give something like
M2_HOME=/usr/local/apache-maven/apache-maven-3.1.1

typing env | grep JAVA_HOME should give like this:
JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.7.0_40.jdk/Contents/Home
Now you have the PATH for M2_HOME and JAVA_HOME.


now open .bash_profile on Terminal  if you don't have one just create bash_profile
vi ~/.bash_profile
Add the following:

#set JAVA_HOME

JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.7.0_40.jdk/Contents/Home

export JAVA_HOME

M2_HOME=/usr/local/apache-maven/apache-maven-3.1.1

export M2_HOME

PATH=$PATH:$JAVA_HOME/bin:$M2_HOME/bin

export PATH

After this click on esc button and : and wq so that your file will save.

Now type

source ~/.bash_profile   click enter

This steps executes the commands in the .bash_profile file and you are good to go now.

Now type mvn --version

How to install java on mac

How to install java on mac laptop
Installation steps you can get here
https://www.java.com/en/download/help/mac_install.xml

Java installation on mac help video

How to setup eclipse on mac

How to setup eclipse on mac laptop.

http://www.cs.dartmouth.edu/~cs5/install/eclipse-osx/