Ruben found a way to setup fake X-server in server side, that one could use ImageJ silently from client. In a sense, ImageJ head is existing so it's not really headless but it might be even less problem than using headless.jar since the silent mode described below could handle awt instances within fake-X so that ImageJ works as same as what you see on your local machine (but silently).
Startup your ssh client (putty or so) and connect to a server. Foe example
ssh YOURNAME@clnode336
You need to enter password, then
setenv DISPLAY :1
Xvfb :1 &
(error, but return) then invoke ij such as
imagej
with this, nothing happens but imagej is running remotely. You could then pass macro or scripts by adding argument.
after finishing the process, terminate the Xvfb by
fg
to bring the X forward, then kill the session if you are done.
An example command could be
fiji -macro whatevermacro.ijm