You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@netbeans.apache.org by "John Neffenger (Jira)" <ji...@apache.org> on 2019/10/06 20:01:00 UTC

[jira] [Created] (NETBEANS-3209) Add JAVA_HOME and ANT_HOME note to build steps

John Neffenger created NETBEANS-3209:
----------------------------------------

             Summary: Add JAVA_HOME and ANT_HOME note to build steps
                 Key: NETBEANS-3209
                 URL: https://issues.apache.org/jira/browse/NETBEANS-3209
             Project: NetBeans
          Issue Type: Improvement
          Components: website
    Affects Versions: 11.2
         Environment: N/A
            Reporter: John Neffenger
            Assignee: John Neffenger


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|https://netbeans.apache.org/download/dev/index.html]
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|https://github.com/apache/netbeans/blob/master/README.md] (GitHub README.md)
Requirements
* Git
* 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:

{noformat}
$ which ant
/usr/bin/ant
$ ant -diagnostics | grep -e ant.version -e java.version
ant.version: Apache Ant(TM) version 1.9.6 compiled on July 20 2018
ant.java.version: 1.8
java.version : 1.8.0_222

$ export JAVA_HOME=$HOME/opt/jdk-13
$ export ANT_HOME=$HOME/opt/apache-ant-1.10.7
$ which ant
/usr/bin/ant
$ ant -diagnostics | grep -e ant.version -e java.version
ant.version: Apache Ant(TM) version 1.10.7 compiled on September 1 2019
ant.java.version: 13
java.version : 13
java.version.date : 2019-09-17
{noformat}

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|https://mail-archives.apache.org/mod_mbox/netbeans-dev/201910.mbox/%3C26c1f141-b021-4473-059f-41ec0b5e3613%40status6.com%3E]




--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@netbeans.apache.org
For additional commands, e-mail: commits-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists