
If you looking for the way to create a standalone executable jar looks like selenium-server-standalone-2.40.0.jar , which can be run with command 'java -jar selenium-server-standalone-2.40.0.jar', from selenium source code, then here is the answer for you.
What you need before start
JDK...