Here is the command to install rosjava from the package manager:
$ sudo apt-get install ros-<rosversion_name>-rosjava
For example, for Kinetic, use the following command:
$ sudo apt-get install ros-kinetic-rosjava
For Indigo, you can use the following command:
$ sudo apt-get install ros-indigo-rosjava