You have two ways to run your tests in phantomjs, but first you have to install/unzip phantomjs somewhere and extend your PATH variable to it.
First: You can use the Ghostdriver java bindings through Maven pom.xml
(you need to include the library in your Eclipse project) like in here
<dependency>
<groupId>com.github.detro.ghostdriver</groupId>
<artifactId>phantomjsdriver</artifactId>
<version>LATEST_VERSION_HERE</version>
</dependency>
and then instantiate your WebDriver this way:
WebDriver driver = new PhantomJSDriver();
Second: Run phantomjs in WebDriver mode (in separate console window or as a shortcut) through
phantomjs --webdriver=4444
like in here and then instantiate the WebDriver in java through:
WebDriver driver = new RemoteWebDriver(
new Uri("http://127.0.0.1:4444/wd/hub"),
DesiredCapabilities.phantomjs()
);
See also another question for use as a hub.