Eclipse doesn’t provide a direct global setting to always use Java Compare for Java files, but you can set it per file type:
Go to Window → Preferences → General → Editors → File Associations.
Find .java in the file types list.
In the Associated editors section, select Java Compare and click Default.
After this, whenever you open a Java file for comparison, Eclipse should prefer the Java Compare editor instead of the generic text compare.
If Git still opens the standard compare, a workaround is to right-click the file → Compare With → HEAD, then manually select Java Compare the first time; Eclipse usually remembers it for future comparisons.
Eclipse doesn’t have a built-in preference to force Git staging view to always use Java Compare globally.