Compare library throwing java.nio.file.FileAlreadyExistsException: /tmp

While initiating Compare class in java, it’s throwing below Exception.
Comparer comparer = new Comparer(inputStream);

java.nio.file.FileAlreadyExistsException: /tmp : Can't create temp file!

System : Mac
version : com.groupdocs:groupdocs-comparison:jar:24.7

Kindly help resolve the issue.

@sarfraz.ahmad
We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): COMPARISONJAVA-1674

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.

Hi @sarfraz.ahmad !

Thank you for your request!
Can you please share more about your Mac machine and environment?
Is it x86 or arm platform? and OS version

Hi,
Its a x86 machine with OS version Sonoma 14.7.1

Hi @sarfraz.ahmad

We are still investigating this issue on Mac environments. Once we will have some news I will update you with an approximate available fix.
Thank you!

Any updates pls?

@sarfraz.ahmad we have no any updates for now, will notify you once we’ll have anything

Hi @sarfraz.ahmad,

Sorry this took so long. The issue is fixed in GroupDocs.Comparison for Java 26.10, which is now available:

<dependency>
    <groupId>com.groupdocs</groupId>
    <artifactId>groupdocs-comparison</artifactId>
    <version>26.10</version>
</dependency>

What was wrong

The failure did not depend on the Mac’s architecture or OS version; the cause was the temp directory path. On macOS /tmp is not a real directory but a symbolic link to /private/tmp. When java.io.tmpdir points at /tmp, the library made sure the temp directory existed by calling Files.createDirectories. That method checks an existing path without following links, so it sees /tmp as “something that exists and is not a directory” and throws:

java.nio.file.FileAlreadyExistsException: /tmp : Can't create temp file!

This happened while the Comparer was being created, so it failed before any document was read. The same failure occurs on any system where java.io.tmpdir is a symbolic link. The macOS default temp directory (/var/folders/.../T) is a real directory and was not affected.

What changed

A temp directory that already exists is now used as is, including when it is reached through a symbolic link. A directory that does not exist yet is still created. This is covered by a test that creates the temp file under a linked directory.

If you cannot upgrade right away

On 24.7 and other earlier versions, point the JVM at the real directory:

-Djava.io.tmpdir=/private/tmp

You can also simply leave java.io.tmpdir unset on macOS and use the default.

Before upgrading from 24.7

26.10 is a large step from 24.7, and a few changes in later versions alter existing behaviour. For example, external resources referenced by a document (such as remote images) are no longer loaded by default. Please check the “Behaviour changes” section of the 26.10 release notes:

Please let us know whether 26.10 works for you.