netbeans-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From John Neffenger <>
Subject Re: Building NetBeans 11.1 from source fails with compile errors
Date Sat, 05 Oct 2019 16:04:04 GMT
On 10/4/19 12:27 PM, Neil C Smith wrote:
> After making sure both java -version and javac -version give 8,
> cd into the netbeans directory and run `ant` as per
Thank you, Neil. That prompted me to figure out how I got off to such a 
bad start. It was JAVA_HOME.

I think it went like this ...

I made sure, as you suggest, to have the correct JDK and Ant versions on 
my PATH:

   $ which java; java -version
   openjdk version "1.8.0_222"
   OpenJDK Runtime Environment
     (build 1.8.0_222-8u222-b10-1ubuntu1~16.04.1-b10)
   OpenJDK 64-Bit Server VM (build 25.222-b10, mixed mode)

   $ which javac; javac -version
   javac 1.8.0_222

   $ which ant; ant -version
   Apache Ant(TM) version 1.10.7 compiled on September 1 2019

But when I ran the build, I got compilation errors:

   $ ant

error: reference to newFileSystem is ambiguous
   [javac] ctSym2FileSystem.put(file, fs = 
FileSystems.newFileSystem(file, null));
   [javac]                                            ^
   [javac] both method newFileSystem(Path,ClassLoader) in FileSystems 
and method newFileSystem(Path,Map<String,?>) in FileSystems match
   [javac] 4 errors
   [javac] 9 warnings

   Total time: 16 seconds

The compilation errors were due to Ant using the JDK commands defined by 
the JAVA_HOME environment variable instead of the ones on my PATH:

   $ ant -diagnostics | grep java.version 13
   java.version : 13 : 2019-09-17

And JAVA_HOME was defined because I'm building NetBeans on my 
development workstation instead of on a separate build machine as I do 
for JavaFX and the JDK.

I think "mlist" had a similar problem with ANT_HOME, which will cause 
the "ant" command on your PATH to transform itself into whatever version 
is defined by the environment variable! Setting all these environment 
variables explicitly in a simple Bash script solved the problems for 
both of us.

In retrospect, it would be nice to have a fourth item on the page you 

   Apache NetBeans source and daily builds

   Building from source

   You can of course build Apache NetBeans from source. To do so:

   1. Clone the GitHub repository.
   2. Install Oracle’s Java or Open JDK (v8, v11).
   3. Install Apache Ant 1.10 or greater (
   4. Unset JAVA_HOME and ANT_HOME, or set them both appropriately.

Thanks again,

To unsubscribe, e-mail:
For additional commands, e-mail:

For further information about the NetBeans mailing lists, visit:

View raw message