Provide better error message when using :: in java_import (fixes #2074)

raise an error with the wrong type of strings, as per irc:

<enebo>  I think it should be documented as saying this is Java calling format but we can probably look for ‘::’ in code and generate a better error message since I don’t think that is allowable in classname