This is a request to add a brief note about the JAVA_HOME and ANT_HOME environment variables to the build instructions on the Web site and the GitHub repository. The changes on the two pages are as follows:
Apache NetBeans source and daily builds
You can of course build Apache NetBeans from source. To do so:
- Clone the https://github.com/apache/netbeans GitHub repository.
- Install Oracle’s Java or Open JDK (v8, v11).
- Install Apache Ant 1.10 or greater (https://ant.apache.org/).
- Set JAVA_HOME and ANT_HOME appropriately or leave them undefined.
Apache NetBeans (GitHub README.md)
- Ant 1.9.9 or above
- JDK 8 or 11 (to build NetBeans)
- JDK 9 or above (to run NetBeans)
- MinGW (optional), to build Windows Launchers
Note: Set JAVA_HOME and ANT_HOME appropriately or leave them undefined.
The hidden effect of the JAVA_HOME and ANT_HOME environment variables can be a trap for developers not familiar with their use by Apache Ant. The build fails if JAVA_HOME or ANT_HOME point to a different version than the one required by NetBeans, even when the correct version is found on the PATH environment variable.
Ant will override whatever is found on the PATH with the values of JAVA_HOME or ANT_HOME, as shown below:
Now that a new JDK is released every six months, the JAVA_HOME environment variable on a developer's workstation is more likely to point to a version other than JDK 8 or 11 required by NetBeans. And because NetBeans is a graphical application often run and debugged from another copy of NetBeans, it is more likely to be built directly on a developer's workstation rather than on a separate build system.
Please see the following message from the mailing list for details:
Re: Building NetBeans 11.1 from source fails with compile errors