I am attempting to create a package for my project in IntelliJ IDEA. I am naming the package 'com.mydomain.switch' Switch being the project name, but as soon as I type 'switch' it shows an error.
The only thing I can think of is that 'switch' is a Java keyword, is this the case? and if so what can I do about it?
When creating a package named switch, IntelliJ IDEA displays the following error message:
Not a valid package name, it would be impossible to create a class inside
So, the message is quite clear. What you can do about it: use another name. The possibilities are infinite.
Here is the list of reserved keywords, that can't be used as identifiers: http://docs.oracle.com/javase/specs/jls/se7/html/jls-3.html#jls-3.9
You probably had a space after the packagename.
Intellij will give that error if the packagename ends with a space.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With