First note that there are an infinite number of possible orientations that an object may be in if you only define the z-axis. If you imagine the z-axis as a pole sticking out from the front of an object, that object could freely rotate around it and could be upside down, sideways, etc.
Therefore, there are several ways to match the z-axis of one object to that of another, depending on how you want to handle the remaining two axis'. Here is one possible way (not yet tested) using a method I wrote a while back which works like the Camera's lookAt method, except it's for Object3Ds:
public void lookAt( Object3D object, SimpleVector target )
{
float initialScale = object.getScale();
object.setScale( 1.0f );
SimpleVector direction = new SimpleVector(
target.calcSub( object.getTransformedCenter() ) ).normalize();
Matrix rotationMatrix = new Matrix( direction.getRotationMatrix() );
object.setRotationMatrix( rotationMatrix );
object.setScale( initialScale );
}
So what you would do is add the target object's z-axis to the position of the source object, then have the source object "look at" that point:
SimpleVector lookAtPoint = sourceObject.getTransformedCenter();
lookAtPoint.add( targetObject.getZAxis() );
lookAt( sourceObject, lookAtPoint );
--EDIT--
Oh, and of course if the Camera is what you are moving, you'd just use its getPosition() and lookAt() methods:
SimpleVector lookAtPoint = myCamera.getPosition();
lookAtPoint.add( targetObject.getZAxis() );
myCamera.lookAt( lookAtPoint );