JDK-8165102 : incorrect message from javac
  • Type: Bug
  • Component: tools
  • Sub-Component: javac
  • Affected Version: 9
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • Submitted: 2016-08-30
  • Updated: 2017-02-09
  • Resolved: 2017-01-19
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 10 JDK 9
10Fixed 9 b154Fixed
Related Reports
Duplicate :  
Relates :  
Description
having the following directory / file structure:

myTests/play/weak/modules/
myTests/play/weak/src/wm1
myTests/play/weak/src/wm2

cat myTests/play/weak/src/wm1/module-info.java 
module wm1 {}

cat myTests/play/weak/src/wm2/module-info.java 
module wm2 {}

when executing the command:

javac -d myTests/play/weak/modules --module-source-path myTests/play/weak/  myTests/play/weak/src/wm1/module-info.java
javac fails with the following error:

An exception has occurred in the compiler (9-internal). Please file a bug against the Java compiler via the Java bug reporting page (http://bugreport.java.com) after checking the Bug Database (http://bugs.java.com) for duplicates. Include your program and the following diagnostic in your report. Thank you.
java.lang.NullPointerException
	at jdk.compiler/com.sun.tools.javac.file.Locations$OutputLocationHandler.getLocationForModule(Locations.java:556)
	at jdk.compiler/com.sun.tools.javac.file.Locations.getLocationForModule(Locations.java:1664)
	at jdk.compiler/com.sun.tools.javac.file.JavacFileManager.getLocationForModule(JavacFileManager.java:996)
	at jdk.compiler/com.sun.tools.javac.comp.Modules.getModuleLocation(Modules.java:482)
	at jdk.compiler/com.sun.tools.javac.comp.Modules.getModuleLocation(Modules.java:462)
	at jdk.compiler/com.sun.tools.javac.comp.Modules.setCompilationUnitModules(Modules.java:366)
	at jdk.compiler/com.sun.tools.javac.comp.Modules.enter(Modules.java:265)
	at jdk.compiler/com.sun.tools.javac.comp.Modules.initModules(Modules.java:231)
	at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.initModules(JavaCompiler.java:1043)
	at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:937)
	at jdk.compiler/com.sun.tools.javac.main.Main.compile(Main.java:307)
	at jdk.compiler/com.sun.tools.javac.main.Main.compile(Main.java:160)
	at jdk.compiler/com.sun.tools.javac.Main.compile(Main.java:55)
	at jdk.compiler/com.sun.tools.javac.Main.main(Main.java:41)

javac -d myTests/play/weak/modules --module-source-path myTests/play/weak/src/  myTests/play/weak/src/wm1/module-info.java, issues a warning
Comments
Test header is incorrectly formed.
01-02-2017