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:
import org.openqa.selenium.phantomjs.PhantomJSDriver; import org.openqa.selenium.phantomjs.PhantomJSDriverService;
public void setUp() throws Exception {
DesiredCapabilities DesireCaps = new DesiredCapabilities(); DesireCaps.setCapability(PhantomJSDriverService.PHANTOMJS_EXECUTABLE_PATH_PROPERTY, "C://phantomjs.exe"); WebDriver driver = new PhantomJSDriver(DesireCaps);
import org.openqa.selenium.phantomjs.PhantomJSDriver; import org.openqa.selenium.phantomjs.PhantomJSDriverService; public void setUp() throws Exception { DesiredCapabilities DesireCaps = new DesiredCapabilities(); DesireCaps.setCapability(PhantomJSDriverService.PHANTOMJS_EXECUTABLE_PATH_PROPERTY, "C://phantomjs.exe"); WebDriver driver = new PhantomJSDriver(DesireCaps); NOTE* The location of the .exe may not be in your C drive, so you point it to exactly you've store phantom
You should be good to go after this.