If you installed rosjava from source, source the setup.bash file of its respective environment before trying to run your own node. That should work.