Download the most recent selenium java bindings - 2.45. Then remove the 2.44 (or whatever you're using) from your library.
Then include the following in your code:
DesiredCapabilities caps = new DesiredCapabilities();
caps.setJavascriptEnabled(true); Â Â Â Â Â Â Â Â
caps.setCapability("takesScreenshot", true); Â
caps.setCapability(
            PhantomJSDriverService.PHANTOMJS_EXECUTABLE_PATH_PROPERTY,
            "your custom path\\phantomjs.exe"
          );
WebDriver driver = new  PhantomJSDriver(caps);