First up you need to download Selenium jar files from http://www.seleniumhq.org/download/. Then you'd need an IDE, something like IntelliJ or Eclipse. Then you'll have to map your jar files to those IDEs. Then depending on which language/framework you choose, you'll have to download the relevant library files, for example, if you're using JUnit you'll have to download Junit 4.11 jar file. Finally don't forget to download the drivers for Chrome and Safari (firefox driver comes standard with selenium). Once done, you can start coding and testing your code with the browser of your choice.
To use the java -jar selenium-server-standalone-2.45.0.jar command-line tool you need to install a JDK.
You need to download and install the JDK and the standalone selenium server.
then navigated to mac's folder /usr/local/bin and pasted the downloaded web driver there.
Afterwards just ran the file there by double clicking it.
The file was installed there so that we do not have to specify the WebDriver path when instantiating the browser.
For more detailed walkthrough, you can reference from here.