Java code to launch appium server through eclipse on OS X

Where are you getting the Executor, DefaultExecutor, DefaultExecuteResultHandler, and CommandLine classes from? I just borrowed ideas from other threads on this blog that were discussing issues similar to the one I’ve been facing. This is where I’ve been getting the help from:
Launching and stopping appium server programmtically
and
http://megettingerror.blogspot.in/2015/01/java-code-to-start-appium-server-on-mac.html
but it doesn’t seem to work of my code. Perhaps I’m missing something else?

What is the code that sets up your Appium Driver (what are the lines involved that say new AndroidDriver(…) or new IOSDriver(…))? I’m using appium’s DesiredCapabilities API that allows me to set up the iOS driver.