JavaFileManager UnsupportedOperationException

Jonathan Gibbons jonathan.gibbons at oracle.com
Thu Oct 8 22:35:19 UTC 2015


JavaFileManager has some new methods whose default implementation is to 
throw UOE.

Are you providing your own full custom file manager?  If you are, and 
you are using it in a module-oriented compilation (i.e. -target 9) then 
you need to provide the new methods.

-- Jon

On 10/08/2015 02:16 PM, Keimpe Bronkhorst wrote:
> I'm running with jigsaw build 1.9.0-ea-jigsaw-nightly-h3477-20150929-b83.
> I'm trying to do a JSR199 compilation using 
> ToolProvider.getSystemJavaCompiler(), but the compile fails 
> immediately with the exception below. I don't have access to the 
> sources of this JDK. Does somebody know what I'm doing wrong?
>
> Caused by: java.lang.UnsupportedOperationException
>         at 
> javax.tools.JavaFileManager.listModuleLocations(java.compiler at 9.0/JavaFileManager.java:436)
>         at 
> com.sun.tools.javac.api.ClientCodeWrapper$WrappedJavaFileManager.listModuleLocations(jdk.compiler at 9.0/ClientCodeWrapper.java:387)
>         at 
> com.sun.tools.javac.code.ModuleFinder$ModuleLocationIterator.hasNext(jdk.compiler at 9.0/ModuleFinder.java:129)
>         at 
> com.sun.tools.javac.code.ModuleFinder.scanModulePath(jdk.compiler at 9.0/ModuleFinder.java:242)
>         at 
> com.sun.tools.javac.code.ModuleFinder.findAllModules(jdk.compiler at 9.0/ModuleFinder.java:178)
>         at 
> com.sun.tools.javac.comp.Modules.getUnnamedModuleCompleter(jdk.compiler at 9.0/Modules.java:617)
>         at 
> com.sun.tools.javac.comp.Modules.setCompilationUnitModules(jdk.compiler at 9.0/Modules.java:306)
>         at 
> com.sun.tools.javac.comp.Modules.enter(jdk.compiler at 9.0/Modules.java:174)
>         at 
> com.sun.tools.javac.main.JavaCompiler.initModules(jdk.compiler at 9.0/JavaCompiler.java:1040)
>         at 
> com.sun.tools.javac.main.JavaCompiler.initModules(jdk.compiler at 9.0/JavaCompiler.java:1036)
>         at 
> com.sun.tools.javac.main.JavaCompiler.compile(jdk.compiler at 9.0/JavaCompiler.java:924)
>         at 
> com.sun.tools.javac.api.JavacTaskImpl$1.call(jdk.compiler at 9.0/JavacTaskImpl.java:97)
>         at 
> com.sun.tools.javac.api.JavacTaskImpl$1.call(jdk.compiler at 9.0/JavacTaskImpl.java:93)
>         at 
> com.sun.tools.javac.api.JavacTaskImpl.handleExceptions(jdk.compiler at 9.0/JavacTaskImpl.java:128)
>         at 
> com.sun.tools.javac.api.JavacTaskImpl.doCall(jdk.compiler at 9.0/JavacTaskImpl.java:93)
>         at 
> com.sun.tools.javac.api.JavacTaskImpl.call(jdk.compiler at 9.0/JavacTaskImpl.java:87)
>
> Keimpe Bronkhorst
> JDeveloper
>



More information about the jigsaw-dev mailing list