NPE in build from org.jetbrains.jps.cmdline.ClasspathBootstrap.getResourceFile(ClasspathBootstrap.java:170)

Answered

I am getting this error trying to build a particular module. Any idea what is wrong?

 
java.lang.NullPointerException
at java.base/java.io.File.<init>(File.java:279)
at org.jetbrains.jps.cmdline.ClasspathBootstrap.getResourceFile(ClasspathBootstrap.java:170)
at org.jetbrains.jps.cmdline.ClasspathBootstrap.getExternalJavacProcessClasspath(ClasspathBootstrap.java:139)
at org.jetbrains.jps.javac.ExternalJavacManager.launchExternalJavacProcess(ExternalJavacManager.java:372)
at org.jetbrains.jps.javac.ExternalJavacManager.forkJavac(ExternalJavacManager.java:156)
at org.jetbrains.jps.incremental.java.JavaBuilder.compileJava(JavaBuilder.java:501)
at org.jetbrains.jps.incremental.java.JavaBuilder.compile(JavaBuilder.java:344)
at org.jetbrains.jps.incremental.java.JavaBuilder.doBuild(JavaBuilder.java:269)
at org.jetbrains.jps.incremental.java.JavaBuilder.build(JavaBuilder.java:222)
at org.jetbrains.jps.incremental.IncProjectBuilder.runModuleLevelBuilders(IncProjectBuilder.java:1448)
at org.jetbrains.jps.incremental.IncProjectBuilder.runBuildersForChunk(IncProjectBuilder.java:1126)
at org.jetbrains.jps.incremental.IncProjectBuilder.buildTargetsChunk(IncProjectBuilder.java:1193)
at org.jetbrains.jps.incremental.IncProjectBuilder.buildChunkIfAffected(IncProjectBuilder.java:1087)
at org.jetbrains.jps.incremental.IncProjectBuilder.buildChunks(IncProjectBuilder.java:853)
at org.jetbrains.jps.incremental.IncProjectBuilder.runBuild(IncProjectBuilder.java:443)
at org.jetbrains.jps.incremental.IncProjectBuilder.build(IncProjectBuilder.java:184)
at org.jetbrains.jps.cmdline.BuildRunner.runBuild(BuildRunner.java:135)
at org.jetbrains.jps.cmdline.BuildSession.runBuild(BuildSession.java:294)
at org.jetbrains.jps.cmdline.BuildSession.run(BuildSession.java:127)
at org.jetbrains.jps.cmdline.BuildMain$MyMessageHandler.lambda$channelRead0$0(BuildMain.java:218)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630)
at java.base/java.lang.Thread.run(Thread.java:832)

I am running 2020.2.3 and have tried several different JDK levels for the module.

 

0
6 comments

Do you have a debugger attached to the build process? 

What do you have under "File | Settings | Build, Execution, Deployment | Compiler | User-local builder VM options"? 

See similar case: https://youtrack.jetbrains.com/issue/IDEA-246886

0

The build VM options field is empty.

I have not yet tried attaching a debugger to the build process.

 

0

I tried following the instructions to attach a debugger, using an older version of IDEA (2020.1.4), but when I try to run the remote configuration, nothing happens.

0

I noticed something very strange about the module that fails to build. The IML file was not modifiable in some way that I could not discover. I had to use sudo to move the file out of the way and then create a new IML file.

0

By the way, once I set the debug action, it cannot be turned off. I mean, I can try to turn it off, but builds never start after I do.

0

The answer to the unmodifiable IML file is that it was a copy of a file from a Time Machine backup. Such files have an ACL that prevent modification.

0

Please sign in to leave a comment.