You can use the CompareUI.compareEditor method.
Code:
File left =...;
File right = ...;
final CompareConfiguration cc = new CompareConfiguration();
cc.setLeftLabel(left.getName());
cc.setRightLabel(right.getName);
CompareUI.openCompareEditor(new FileCompareInput(cc, left,right));
where FileCompareInput is an implementation of the abstract class EditorCompareInput.
hope that helps,
Benoit.