I have two packages mg.networktest and mg.networktest.server, both need access to the same class for registering/serializing classes that need to be send over the network. I think the best practice would be to create it on the server package and include it in the client.
However i cannot get the class referenced properly. I also tried adding another package but that is not allowed I think. But it just does not recognize my other package. The imports below all get The import mg.networktest.server cannot be resolved
. I can get it to import mg.networktest.*;
but that just references itself.
import mg.networktest.server; //This is the exact package
import mg.networktest.server.Network; //This is the physical class/.java name
import mg.networktest.server.Network.ChatMessage; //This is one of the classes inside the .java that needs to be included.
To be more clear:
import mg.network.server.*;
.If your import statement causes a compilation error, verify the following:
import TypeName;
. To import type names on demand from a package or class scope, use the syntax import PackageOrTypeName.*;
.