How to fix error building IntelliJ IDEA Ultimate Edition?

Since you are not using the community edition I assume you have a license - then use the JetBrains toolbox app from JetBrains Toolbox App: Manage Your Tools with Ease