Uploaded image for project: 'NetBeans'
  1. NetBeans
  2. NETBEANS-3209

Add JAVA_HOME and ANT_HOME note

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 11.2
    • Fix Version/s: None
    • Component/s: website
    • Environment:
      N/A

      Description

      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:

      1. Clone the https://github.com/apache/netbeans GitHub repository.
      2. Install Oracle’s Java or Open JDK (v8, v11).
      3. Install Apache Ant 1.10 or greater (https://ant.apache.org/).
      4. Set JAVA_HOME and ANT_HOME appropriately or leave them undefined.

      Apache NetBeans (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:

      $ 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
      

      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

        Attachments

          Activity

            People

            • Assignee:
              jgneff John Neffenger
              Reporter:
              jgneff John Neffenger
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 1h 20m
                1h 20m