This page may provide some useful information for you (including an example):
http://seleniumhq.org/documentation/remote-control/languages/java.html
The basic steps you need to do are:
1) Start the selenium rc server on the command line:
java -jar selenium-server.jar
(this should start the server listening on port 4444)
2) In your Java code, create a new instance of Selenium:
Selenium selenium = new DefaultSelenium("localhost", 4444, "*chrome",
"
http://your_test_server/");
selenium.start();
That final argument is the "baseUrl", from which all relative URLs are derived.
3) Don't forget to call "selenium.stop()" when you're done with the
particular browser.
Simon