matandked
matandked

Reputation: 1565

Which characters are not allowed in Java 9 module names?

Dashes are not allowed in the JPMS module names. As I understand it is suggested to replace them with dots.

However I cannot find a list of other not allowed characters in Java modules names with replacement suggestions. For example, is "_" character allowed?

Upvotes: 1

Views: 747

Answers (1)

Andreas
Andreas

Reputation: 159114

The Java Language Specification, section 7.7. Module Declarations, says:

A module name consists of one or more Java identifiers (§3.8) separated by "." tokens.

So the valid characters for a module name is the same as for the fully qualified name of a class.

Upvotes: 5

Related Questions