I hope this wasn't covered someplace else or maybe is some kind of JDK/Java
configuration issues in my netbeans setup but....

With the following java in place...

java -version
openjdk version "13" 2019-09-17
OpenJDK Runtime Environment (build 13+33)
OpenJDK 64-Bit Server VM (build 13+33, mixed mode, sharing)


While trying to compile the latest netbeans from github as of 12/7/2019 of
the master, I got a few compilation errors relating to FileSystem class
methods like the following:


generate-sources-internal:
 [pcompile] Generating 6 resource files to
C:\src\git\netbeans.eric\netbeans\nbbuild\build\langtools\build\gensrc\jdk.jshell
    [mkdir] Created dir:
C:\src\git\netbeans.eric\netbeans\nbbuild\build\langtools\build\nb
    [javac] Compiling 593 source files to
C:\src\git\netbeans.eric\netbeans\nbbuild\build\langtools\build\nb
    [javac] warning: [options] bootstrap class path not set in conjunction
with -source 8
    [javac]
C:\src\git\netbeans.eric\netbeans\nbbuild\build\langtools\src\jdk.compiler\share\classes\com\sun\tools\javac\file\JavacFileManager.java:519:
error: reference to newFileSystem is ambiguous
    [javac]                 this.fileSystem =
FileSystems.newFileSystem(archivePath, null);
    [javac]                                              ^
    [javac]   both method newFileSystem(Path,ClassLoader) in FileSystems
and method newFileSystem(Path,Map<String,?>) in FileSystems match
    [javac]
C:\src\git\netbeans.eric\netbeans\nbbuild\build\langtools\src\jdk.compiler\share\classes\com\sun\tools\javac\file\Locations.java:383:
error: reference to newFileSystem is ambiguous
    [javac]                             FileSystems.newFileSystem(file,
null).close();
    [javac]                                        ^
    [javac]   both method newFileSystem(Path,ClassLoader) in FileSystems
and method newFileSystem(Path,Map<String,?>) in FileSystems match
    [javac]
C:\src\git\netbeans.eric\netbeans\nbbuild\build\langtools\src\jdk.compiler\share\classes\com\sun\tools\javac\model\AnnotationProxyMaker.java:89:
warning: AnnotationParser is internal proprietary API and may be removed in
a future release
    [javac]         return AnnotationParser.annotationForMap(annoType,
    [javac]                ^
    [javac]
C:\src\git\netbeans.eric\netbeans\nbbuild\build\langtools\src\jdk.compiler\share\classes\com\sun\tools\javac\model\AnnotationProxyMaker.java:168:
warning: ExceptionProxy is internal proprietary API and may be removed in a
future release
    [javac]             if (!(value instanceof ExceptionProxy) &&
    [javac]                                    ^
    [javac]
C:\src\git\netbeans.eric\netbeans\nbbuild\build\langtools\src\jdk.compiler\share\classes\com\sun\tools\javac\model\AnnotationProxyMaker.java:169:
warning: AnnotationType is internal proprietary API and may be removed in a
future release
    [javac]
!AnnotationType.invocationHandlerReturnType(returnClass)
    [javac]                  ^
    [javac]
C:\src\git\netbeans.eric\netbeans\nbbuild\build\langtools\src\jdk.compiler\share\classes\com\sun\tools\javac\model\AnnotationProxyMaker.java:205:
warning: ExceptionProxy is internal proprietary API and may be removed in a
future release
    [javac]                         if (value == null || value instanceof
ExceptionProxy) {
    [javac]                                                               ^
    [javac]
C:\src\git\netbeans.eric\netbeans\nbbuild\build\langtools\src\jdk.compiler\share\classes\com\sun\tools\javac\model\AnnotationProxyMaker.java:229:
warning: EnumConstantNotPresentExceptionProxy is internal proprietary API
and may be removed in a future release
    [javac]                     value = new
EnumConstantNotPresentExceptionProxy(
    [javac]                                 ^
    [javac]
C:\src\git\netbeans.eric\netbeans\nbbuild\build\langtools\src\jdk.compiler\share\classes\com\sun\tools\javac\model\AnnotationProxyMaker.java:259:
warning: ExceptionProxy is internal proprietary API and may be removed in a
future release
    [javac]             class AnnotationTypeMismatchExceptionProxy extends
ExceptionProxy {
    [javac]                                                                ^
    [javac]
C:\src\git\netbeans.eric\netbeans\nbbuild\build\langtools\src\jdk.compiler\share\classes\com\sun\tools\javac\model\AnnotationProxyMaker.java:283:
warning: ExceptionProxy is internal proprietary API and may be removed in a
future release
    [javac]     private static final class MirroredTypeExceptionProxy
extends ExceptionProxy {
    [javac]
  ^
    [javac]
C:\src\git\netbeans.eric\netbeans\nbbuild\build\langtools\src\jdk.compiler\share\classes\com\sun\tools\javac\model\AnnotationProxyMaker.java:326:
warning: ExceptionProxy is internal proprietary API and may be removed in a
future release
    [javac]     private static final class MirroredTypesExceptionProxy
extends ExceptionProxy {
    [javac]
   ^
    [javac]
C:\src\git\netbeans.eric\netbeans\nbbuild\build\langtools\src\jdk.compiler\share\classes\com\sun\tools\javac\platform\JDKPlatformProvider.java:80:
error: reference to newFileSystem is ambiguous
    [javac]             try (FileSystem fs =
FileSystems.newFileSystem(ctSymFile, null);
    [javac]                                             ^
    [javac]   both method newFileSystem(Path,ClassLoader) in FileSystems
and method newFileSystem(Path,Map<String,?>) in FileSystems match
    [javac]
C:\src\git\netbeans.eric\netbeans\nbbuild\build\langtools\src\jdk.compiler\share\classes\com\sun\tools\javac\platform\JDKPlatformProvider.java:120:
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

BUILD FAILED


Based on looking around I find with newer versions of java has multiple
FileSystem methods defined so this requires casting the second parameter to
ClassLoader class as described  Java 13 release notes[1]

I thought...this seems like a simple fix (adding a cast) which maybe I
could try to contribute but after making the change and trying to build it
again, the same errors occur.  I came to realize these files are copied
over during build setup, I find the files in question are in the langtools
subfolder which appears to be uncompressed from the external
langtools-9.zip file present so those fixes don't go through.

Assume this is a "downstream" (langtools) sort of change needed (maybe from
java context) which I believe the langtools is managed [2].  But not sure
of this.

Anyone have any ideas on this?

References
[1]  https://www.oracle.com/technetwork/java/13-relnote-issues-5460548.html
[2]
https://github.com/openjdk/jdk13/tree/master/make/langtools/netbeans/langtools



Eric Bresie
[email protected]

Reply via email to