I was wondering how if it was possible to use phatomjs without having to define your phatomjs dir ? so I would only have to use the following code segment.
WebDriver driver = new PhantomJSDriver();
You can avoid having to define the path to phantomjs executable by having it added to PATH environment variable.
Here you can find a quick sample how to do it on Windows.