3

I've created a Java project with the name java9 to play with Java 9 modules. I have the following module-info.java:

module java9 {
    ...
}

However the javac compiler complains about the digit in my module name:

src\module-info.java:1: warning: [module] module name java9 should avoid terminal digits
module java9 {
       ^

And at runtime java complains too:

WARNING: Module name "java9" may soon be illegal

Can anyone explain why terminating digits are forbidden? What are libraries like commons-lang3 supposed to do to avoid this restriction? What if I have a library name like base64 or sha3?

This question does not contain an answer to my question. It answers how to avoid the error but not why Java is so restrictive in the naming scheme.

Community
  • 1
  • 1
ZhekaKozlov
  • 36,558
  • 20
  • 126
  • 155
  • 2
    Check out this earlier question: [How to resolve module-info.java compile error in Jdk9/java-9](http://stackoverflow.com/questions/41849311/how-to-resolve-module-info-java-compile-error-in-jdk9-java-9). There's [discussion about the topic](http://openjdk.java.net/projects/jigsaw/spec/issues/#VersionsInModuleNames) in the Jigsaw issues. – cbr Mar 26 '17 at 02:29
  • 1
    *"why Java is so restrictive in the naming scheme"* It's just a warning, not a restriction. – 4castle Mar 26 '17 at 02:58
  • 2
    *"This question does not contain an answer to my question. It answers how to avoid the error but not why Java is so restrictive in the naming scheme."* - Incorrect. Read this Answer! http://stackoverflow.com/a/41859239/139985 – Stephen C Mar 26 '17 at 03:37
  • @StephenC And why do they discourage people from encoding versions in module names? This is the question. – ZhekaKozlov Mar 26 '17 at 13:28
  • 1
    Erm .. it is not the question that you asked. – Stephen C Mar 26 '17 at 13:29
  • @StephenC Why is it a bad idea? – ZhekaKozlov Mar 26 '17 at 13:30
  • 1
    I said >>they<< think it is a bad idea. – Stephen C Mar 26 '17 at 13:31

0 Answers0